#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <iostream>
#include <map>
#include <string.h>
#include <stdarg.h>

#include <boost/thread/mutex.hpp>

#ifdef _WINDOWS
	#include <Windows.h>
	#include "common.h"
#else
	#include <sys/time.h>
#endif

// ODBC includes
#include <sqlucode.h>

// libodbclogger includes
#include "DynLib.h"
#include "ODBCWrapper.h"

using namespace std;

#define LOG_TO_STDOUT 1
#define LOG_TO_STDERR 2
#define LOG_TO_FILE   3

#define ODBC_DRIVER_ENV_VAR_NAME "ODBC_DRIVER"
#define ODBC_DRIVER_ENV_LOG_OUTPUT "ODBC_DRIVER_LOG_OUTPUT"
#define LOG_PREFIX L"[ODBC Logging Driver] "

#ifndef timersub

#endif

/**
 * NASTY GLOBAL VARIABLES
 */
static boost::mutex initMutex;

static ODBCWrapper *_logging_odbc_driver_wrapper = NULL;

static int _logging_odbc_driver_output_method = 0;

static FILE* _logging_odbc_driver_output_file = 0;

ODBCWrapper *getWrapper() {

    boost::mutex::scoped_lock lock(initMutex);

    if (_logging_odbc_driver_wrapper==NULL) {

        char *driverPath = getenv(ODBC_DRIVER_ENV_VAR_NAME);
        if (driverPath==NULL) {
            cerr << LOG_PREFIX << "Environment variable " << ODBC_DRIVER_ENV_VAR_NAME << " is not defined" << endl;
            return NULL;
        }

        _logging_odbc_driver_wrapper = new ODBCWrapper(driverPath);
        if (!_logging_odbc_driver_wrapper->init()) {
            cerr << LOG_PREFIX << "Failed to initialize library " << driverPath << endl;
            delete _logging_odbc_driver_wrapper;
            _logging_odbc_driver_wrapper = NULL;
            return NULL;
        }
    }

    return _logging_odbc_driver_wrapper;
}

wchar_t* formatSQLCHAR(SQLCHAR* str) {
    if (str==NULL) {
        wchar_t *temp = (wchar_t *) new wchar_t[1];
        temp[0] = L'\0';
        return temp;
    }
    int len = strlen((char*)str);
    wchar_t *temp = (wchar_t *) new wchar_t[len+1];
    swprintf(temp, L"%s", (char*)str);
    return temp;
}

wchar_t* formatSQLWCHAR(SQLWCHAR* str) {
    if (str==NULL) {
        wchar_t *temp = (wchar_t *) new wchar_t[1];
        temp[0] = L'\0';
        return temp;
    }
	//wstring temp2 = (wchar_t *)str;
    int len = ((wstring)((wchar_t*)str)).length();
    wchar_t *temp = (wchar_t *) new wchar_t[len+1];
    swprintf(temp, L"%s", (wchar_t*)str);
    return temp;
}

wchar_t* formatPointer(void *p) {
    wchar_t *temp = (wchar_t *) new wchar_t[32];
    swprintf(temp, L"%p", p);
    return temp;
}

wchar_t* formatSQLHENV(void *p) {
    return formatPointer(p);
}

wchar_t* formatSQLHDBC(void *p) {
    return formatPointer(p);
}

wchar_t* formatSQLHSTMT(void *p) {
    return formatPointer(p);
}

wchar_t* formatSQLHDESC(void *p) {
    return formatPointer(p);
}

wchar_t* formatSQLHWND(void *p) {
    return formatPointer(p);
}

wchar_t* formatSQLHANDLE(void *p) {
    return formatPointer(p);
}

wchar_t* formatSQLPOINTER(void *p) {
    return formatPointer(p);
}

wchar_t* formatSQLLEN(SQLLEN l) {
    wchar_t *temp = (wchar_t *) new wchar_t[32];
#if (SIZEOF_LONG == 8)
    swprintf(temp, L"%d", l);
#else
    swprintf(temp, L"%ld", l);
#endif
    return temp;
}

wchar_t* formatSQLULEN(SQLULEN l) {
    wchar_t *temp = (wchar_t *) new wchar_t[32];
#if (SIZEOF_LONG == 8)
    swprintf(temp, L"%d", l);
#else
    swprintf(temp, L"%ld", l);
#endif
    return temp;
}

wchar_t* formatSQLSETPOSIROW(SQLSETPOSIROW l) {
#ifdef _WIN64
    wchar_t *temp = (wchar_t *) new wchar_t[32];
    swprintf(temp, L"%ld", l);
    return temp;
#else
	wchar_t *temp = formatSQLUSMALLINT((SQLUSMALLINT) l);
	return temp;
#endif
}

wchar_t* formatSQLINTEGER(SQLINTEGER l) {
    wchar_t *temp = (wchar_t *) new wchar_t[32];
    swprintf(temp, L"%d", l);
    return temp;
}

wchar_t* formatSQLSMALLINT(SQLSMALLINT l) {
    wchar_t *temp = (wchar_t *) new wchar_t[32];
    swprintf(temp, L"%d", l);
    return temp;
}

wchar_t* formatSQLUSMALLINT(SQLUSMALLINT l) {
    wchar_t *temp = (wchar_t *) new wchar_t[32];
    swprintf(temp, L"%d", l);
    return temp;
}

void log_odbc_call(wstring functionName, SQLRETURN ret, struct timeval *tvStart, struct timeval *tvEnd, int numArgs, ...) {

    // output format should be something like this
    // [ODBC Logging Driver][SQL_SUCCESS][1.012345][SQLExecDirect][StatementHandle][0x1234567][SQL][SELECT * FROM foo]


    // return code
	const wchar_t *returnCode = L"UNKNOWN";
	switch (ret) {
		case SQL_SUCCESS:
			returnCode = L"SQL_SUCCESS";
			break;
		case SQL_SUCCESS_WITH_INFO:
			returnCode = L"SQL_SUCCESS_WITH_INFO";
			break;
		case SQL_ERROR:
			returnCode = L"SQL_ERROR";
			break;
		case SQL_NO_DATA:
			returnCode = L"SQL_NO_DATA";
			break;
		case SQL_INVALID_HANDLE:
			returnCode = L"SQL_INVALID_HANDLE";
			break;
		case SQL_STILL_EXECUTING:
			returnCode = L"SQL_STILL_EXECUTING";
			break;
	}

    // calculate elapsed time in seconds
    struct timeval tvDiff;
	timersub(tvEnd, tvStart, &tvDiff);
	wchar_t temp[64]; //TODO: is this definitely large enough?
	swprintf(temp, L"%hld.%h06ld", tvDiff.tv_sec, tvDiff.tv_usec);

    wstring outputLine = wstring(L"[") + wstring(returnCode)
        + wstring(L"][") + wstring(temp)
        + wstring(L"][") + functionName
        + wstring(L"][") + formatSQLINTEGER((SQLINTEGER)numArgs)
        + wstring(L"]");

    //TODO: write code to read varargs and add to output line - see this web page to get started

    // http://www.eskimo.com/~scs/cclass/int/sx11b.html

    va_list argp;
    va_start(argp, numArgs);

    for (int i=1; i<=numArgs; i++) {

        //cerr << functionName << " arg " << i << " of " << numArgs << endl;

        wchar_t *argType = va_arg(argp, wchar_t*);
        //cerr << "argType " << argType << endl;

        wchar_t *argName = va_arg(argp, wchar_t*);
        //cerr << "argName " << argName << endl;

        wchar_t *argValue = va_arg(argp, wchar_t*);
        //cerr << "argValue " << argValue << endl;

        outputLine += wstring(L"[") + wstring(argType)
                    + wstring(L"][") + wstring(argName)
                    + wstring(L"][") + argValue
                    + wstring(L"]");

    }

    va_end(argp);

    // initialize logging
    if (_logging_odbc_driver_output_method == 0) {

        boost::mutex::scoped_lock lock(initMutex);

        char *logOutput = getenv(ODBC_DRIVER_ENV_LOG_OUTPUT);

        if (logOutput==NULL || strcmp(logOutput, "STDERR")==0) {
            _logging_odbc_driver_output_method = LOG_TO_STDERR;
        }
        else if (strcmp(logOutput, "STDOUT")==0) {
            _logging_odbc_driver_output_method = LOG_TO_STDOUT;
        }
        else {
            _logging_odbc_driver_output_method = LOG_TO_FILE;
            const char *filename = logOutput;

            _logging_odbc_driver_output_file = fopen(filename, "a");
            if (_logging_odbc_driver_output_file==NULL) {
                cerr << "Failed to open file " << filename << ". Using STDERR instead." << endl;
            }
        } 
    }
            
    // output the logging line
    switch (_logging_odbc_driver_output_method) {
        case LOG_TO_STDOUT:
            wcout << LOG_PREFIX << outputLine << endl;
            break;
        default:	
        case LOG_TO_STDERR:
            wcerr << LOG_PREFIX << outputLine << endl;
            break;
        case LOG_TO_FILE:
            if (_logging_odbc_driver_output_file != NULL) {
                boost::mutex::scoped_lock lock(initMutex);
				//wstring temp = wstring(LOG_PREFIX) + outputLine;
				//fputws(outputLine, _logging_odbc_driver_output_file);
                fwprintf(_logging_odbc_driver_output_file, L"%s%s\n", LOG_PREFIX, outputLine.c_str());
				fflush(_logging_odbc_driver_output_file);
            }
            else {
                wcerr << LOG_PREFIX << outputLine << endl;
            }
            break;
    }
}


SQLRETURN notImplemented(const char *functionName) {
    // log detailed error information
	cerr << LOG_PREFIX << string("Call to unimplemented function: ") + string(functionName) << endl;
	// return error code
	return SQL_ERROR;
}


// CODE GENERATED ...
SQLRETURN SQL_API SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, __out SQLHANDLE *OutputHandle)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLAllocHandle(HandleType, InputHandle, OutputHandle);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLSMALLINT(HandleType);
	wchar_t* arg2 = formatSQLHANDLE(InputHandle);
	wchar_t* arg3 = formatPointer((void*)OutputHandle);
	log_odbc_call(L"SQLAllocHandle", ret, &tvStart, &tvEnd, 3, L"SQLSMALLINT", L"HandleType", arg1, L"SQLHANDLE", L"InputHandle", arg2, L"SQLHANDLE*", L"OutputHandle", arg3);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	return ret;
}

SQLRETURN SQL_API SQLBindCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, __inout_xcount_opt(BufferLength) SQLPOINTER TargetValue, SQLLEN BufferLength, __inout_opt SQLLEN *StrLen_or_Ind)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLBindCol(StatementHandle, ColumnNumber, TargetType, TargetValue, BufferLength, StrLen_or_Ind);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(StatementHandle);
	wchar_t* arg2 = formatSQLUSMALLINT(ColumnNumber);
	wchar_t* arg3 = formatSQLSMALLINT(TargetType);
	wchar_t* arg4 = formatSQLPOINTER(TargetValue);
	wchar_t* arg5 = formatSQLLEN(BufferLength);
	wchar_t* arg6 = formatPointer((void*)StrLen_or_Ind);
	log_odbc_call(L"SQLBindCol", ret, &tvStart, &tvEnd, 6, L"SQLHSTMT", L"StatementHandle", arg1, L"SQLUSMALLINT", L"ColumnNumber", arg2, L"SQLSMALLINT", L"TargetType", arg3, L"SQLPOINTER", L"TargetValue", arg4, L"SQLLEN", L"BufferLength", arg5, L"SQLLEN*", L"StrLen_or_Ind", arg6);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	return ret;
}

SQLRETURN SQL_API SQLBindParameter( SQLHSTMT           hstmt, SQLUSMALLINT       ipar, SQLSMALLINT        fParamType, SQLSMALLINT        fCType, SQLSMALLINT        fSqlType, SQLULEN            cbColDef, SQLSMALLINT        ibScale, SQLPOINTER         rgbValue, SQLLEN             cbValueMax, SQLLEN             *pcbValue)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLBindParameter(hstmt, ipar, fParamType, fCType, fSqlType, cbColDef, ibScale, rgbValue, cbValueMax, pcbValue);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLUSMALLINT(ipar);
	wchar_t* arg3 = formatSQLSMALLINT(fParamType);
	wchar_t* arg4 = formatSQLSMALLINT(fCType);
	wchar_t* arg5 = formatSQLSMALLINT(fSqlType);
	wchar_t* arg6 = formatSQLULEN(cbColDef);
	wchar_t* arg7 = formatSQLSMALLINT(ibScale);
	wchar_t* arg8 = formatSQLPOINTER(rgbValue);
	wchar_t* arg9 = formatSQLLEN(cbValueMax);
	wchar_t* arg10 = formatPointer((void*)pcbValue);
	log_odbc_call(L"SQLBindParameter", ret, &tvStart, &tvEnd, 10, L"SQLHSTMT", L"hstmt", arg1, L"SQLUSMALLINT", L"ipar", arg2, L"SQLSMALLINT", L"fParamType", arg3, L"SQLSMALLINT", L"fCType", arg4, L"SQLSMALLINT", L"fSqlType", arg5, L"SQLULEN", L"cbColDef", arg6, L"SQLSMALLINT", L"ibScale", arg7, L"SQLPOINTER", L"rgbValue", arg8, L"SQLLEN", L"cbValueMax", arg9, L"SQLLEN*", L"pcbValue", arg10);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	delete [] arg8;
	delete [] arg9;
	delete [] arg10;
	return ret;
}

SQLRETURN SQL_API SQLBrowseConnect( SQLHDBC            hdbc, __in_ecount(cchConnStrIn) SQLCHAR           *szConnStrIn, SQLSMALLINT        cchConnStrIn, __out_ecount_opt(cchConnStrOutMax) SQLCHAR           *szConnStrOut, SQLSMALLINT        cchConnStrOutMax, __out_opt SQLSMALLINT       *pcchConnStrOut)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLBrowseConnect(hdbc, szConnStrIn, cchConnStrIn, szConnStrOut, cchConnStrOutMax, pcchConnStrOut);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHDBC(hdbc);
	wchar_t* arg2 = formatSQLCHAR(szConnStrIn);
	wchar_t* arg3 = formatSQLSMALLINT(cchConnStrIn);
	wchar_t* arg4 = formatSQLCHAR(szConnStrOut);
	wchar_t* arg5 = formatSQLSMALLINT(cchConnStrOutMax);
	wchar_t* arg6 = formatPointer((void*)pcchConnStrOut);
	log_odbc_call(L"SQLBrowseConnect", ret, &tvStart, &tvEnd, 6, L"SQLHDBC", L"hdbc", arg1, L"SQLCHAR*", L"szConnStrIn", arg2, L"SQLSMALLINT", L"cchConnStrIn", arg3, L"SQLCHAR*", L"szConnStrOut", arg4, L"SQLSMALLINT", L"cchConnStrOutMax", arg5, L"SQLSMALLINT*", L"pcchConnStrOut", arg6);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	return ret;
}

SQLRETURN SQL_API SQLBrowseConnectW ( SQLHDBC             hdbc, __in_ecount(cchConnStrIn) SQLWCHAR* szConnStrIn, SQLSMALLINT         cchConnStrIn, __out_ecount_opt(cchConnStrOutMax) SQLWCHAR* szConnStrOut, SQLSMALLINT         cchConnStrOutMax, __out_opt SQLSMALLINT*        pcchConnStrOut )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLBrowseConnectW (hdbc, szConnStrIn, cchConnStrIn, szConnStrOut, cchConnStrOutMax, pcchConnStrOut);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHDBC(hdbc);
	wchar_t* arg2 = formatSQLWCHAR(szConnStrIn);
	wchar_t* arg3 = formatSQLSMALLINT(cchConnStrIn);
	wchar_t* arg4 = formatSQLWCHAR(szConnStrOut);
	wchar_t* arg5 = formatSQLSMALLINT(cchConnStrOutMax);
	wchar_t* arg6 = formatPointer((void*)pcchConnStrOut);
	log_odbc_call(L"SQLBrowseConnectW ", ret, &tvStart, &tvEnd, 6, L"SQLHDBC", L"hdbc", arg1, L"SQLWCHAR*", L"szConnStrIn", arg2, L"SQLSMALLINT", L"cchConnStrIn", arg3, L"SQLWCHAR*", L"szConnStrOut", arg4, L"SQLSMALLINT", L"cchConnStrOutMax", arg5, L"SQLSMALLINT*", L"pcchConnStrOut", arg6);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	return ret;
}

SQLRETURN SQL_API SQLBulkOperations( SQLHSTMT            StatementHandle, SQLSMALLINT         Operation)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLBulkOperations(StatementHandle, Operation);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(StatementHandle);
	wchar_t* arg2 = formatSQLSMALLINT(Operation);
	log_odbc_call(L"SQLBulkOperations", ret, &tvStart, &tvEnd, 2, L"SQLHSTMT", L"StatementHandle", arg1, L"SQLSMALLINT", L"Operation", arg2);
	delete [] arg1;
	delete [] arg2;
	return ret;
}

SQLRETURN SQL_API SQLCancel(SQLHSTMT StatementHandle)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLCancel(StatementHandle);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(StatementHandle);
	log_odbc_call(L"SQLCancel", ret, &tvStart, &tvEnd, 1, L"SQLHSTMT", L"StatementHandle", arg1);
	delete [] arg1;
	return ret;
}

SQLRETURN SQL_API SQLCloseCursor(SQLHSTMT StatementHandle)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLCloseCursor(StatementHandle);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(StatementHandle);
	log_odbc_call(L"SQLCloseCursor", ret, &tvStart, &tvEnd, 1, L"SQLHSTMT", L"StatementHandle", arg1);
	delete [] arg1;
	return ret;
}

#ifdef _WIN64
SQLRETURN SQL_API SQLColAttribute (SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, __out_bcount_opt(BufferLength) SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, __out_opt SQLSMALLINT *StringLength, __out_opt SQLLEN *NumericAttribute)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLColAttribute (StatementHandle, ColumnNumber, FieldIdentifier, CharacterAttribute, BufferLength, StringLength, NumericAttribute);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(StatementHandle);
	wchar_t* arg2 = formatSQLUSMALLINT(ColumnNumber);
	wchar_t* arg3 = formatSQLUSMALLINT(FieldIdentifier);
	wchar_t* arg4 = formatSQLPOINTER(CharacterAttribute);
	wchar_t* arg5 = formatSQLSMALLINT(BufferLength);
	wchar_t* arg6 = formatPointer((void*)StringLength);
	wchar_t* arg7 = formatPointer((void*)NumericAttribute);
	log_odbc_call(L"SQLColAttribute ", ret, &tvStart, &tvEnd, 7, L"SQLHSTMT", L"StatementHandle", arg1, L"SQLUSMALLINT", L"ColumnNumber", arg2, L"SQLUSMALLINT", L"FieldIdentifier", arg3, L"SQLPOINTER", L"CharacterAttribute", arg4, L"SQLSMALLINT", L"BufferLength", arg5, L"SQLSMALLINT*", L"StringLength", arg6, L"SQLLEN*", L"NumericAttribute", arg7);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	return ret;
}

SQLRETURN SQL_API SQLColAttributeW ( SQLHSTMT        hstmt, SQLUSMALLINT    iCol, SQLUSMALLINT    iField, __out_bcount_opt(cbDescMax) SQLPOINTER      pCharAttr, SQLSMALLINT     cbDescMax, __out_opt SQLSMALLINT     *pcbCharAttr, __out_opt SQLLEN          *pNumAttr )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLColAttributeW (hstmt, iCol, iField, pCharAttr, cbDescMax, pcbCharAttr, pNumAttr);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLUSMALLINT(iCol);
	wchar_t* arg3 = formatSQLUSMALLINT(iField);
	wchar_t* arg4 = formatSQLPOINTER(pCharAttr);
	wchar_t* arg5 = formatSQLSMALLINT(cbDescMax);
	wchar_t* arg6 = formatPointer((void*)pcbCharAttr);
	wchar_t* arg7 = formatPointer((void*)pNumAttr);
	log_odbc_call(L"SQLColAttributeW ", ret, &tvStart, &tvEnd, 7, L"SQLHSTMT", L"hstmt", arg1, L"SQLUSMALLINT", L"iCol", arg2, L"SQLUSMALLINT", L"iField", arg3, L"SQLPOINTER", L"pCharAttr", arg4, L"SQLSMALLINT", L"cbDescMax", arg5, L"SQLSMALLINT*", L"pcbCharAttr", arg6, L"SQLLEN*", L"pNumAttr", arg7);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	return ret;
}

#else
SQLRETURN SQL_API SQLColAttribute (SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, __out_bcount_opt(BufferLength) SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, __out_opt SQLSMALLINT *StringLength, __out_opt SQLPOINTER NumericAttribute)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLColAttribute (StatementHandle, ColumnNumber, FieldIdentifier, CharacterAttribute, BufferLength, StringLength, NumericAttribute);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(StatementHandle);
	wchar_t* arg2 = formatSQLUSMALLINT(ColumnNumber);
	wchar_t* arg3 = formatSQLUSMALLINT(FieldIdentifier);
	wchar_t* arg4 = formatSQLPOINTER(CharacterAttribute);
	wchar_t* arg5 = formatSQLSMALLINT(BufferLength);
	wchar_t* arg6 = formatPointer((void*)StringLength);
	wchar_t* arg7 = formatSQLPOINTER(NumericAttribute);
	log_odbc_call(L"SQLColAttribute ", ret, &tvStart, &tvEnd, 7, L"SQLHSTMT", L"StatementHandle", arg1, L"SQLUSMALLINT", L"ColumnNumber", arg2, L"SQLUSMALLINT", L"FieldIdentifier", arg3, L"SQLPOINTER", L"CharacterAttribute", arg4, L"SQLSMALLINT", L"BufferLength", arg5, L"SQLSMALLINT*", L"StringLength", arg6, L"SQLPOINTER", L"NumericAttribute", arg7);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	return ret;
}

SQLRETURN SQL_API SQLColAttributeW( SQLHSTMT        hstmt, SQLUSMALLINT    iCol, SQLUSMALLINT    iField, __out_bcount_opt(cbDescMax) SQLPOINTER      pCharAttr, SQLSMALLINT     cbDescMax, __out_opt SQLSMALLINT     *pcbCharAttr, __out_opt SQLPOINTER      pNumAttr)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLColAttributeW(hstmt, iCol, iField, pCharAttr, cbDescMax, pcbCharAttr, pNumAttr);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLUSMALLINT(iCol);
	wchar_t* arg3 = formatSQLUSMALLINT(iField);
	wchar_t* arg4 = formatSQLPOINTER(pCharAttr);
	wchar_t* arg5 = formatSQLSMALLINT(cbDescMax);
	wchar_t* arg6 = formatPointer((void*)pcbCharAttr);
	wchar_t* arg7 = formatSQLPOINTER(pNumAttr);
	log_odbc_call(L"SQLColAttributeW", ret, &tvStart, &tvEnd, 7, L"SQLHSTMT", L"hstmt", arg1, L"SQLUSMALLINT", L"iCol", arg2, L"SQLUSMALLINT", L"iField", arg3, L"SQLPOINTER", L"pCharAttr", arg4, L"SQLSMALLINT", L"cbDescMax", arg5, L"SQLSMALLINT*", L"pcbCharAttr", arg6, L"SQLPOINTER", L"pNumAttr", arg7);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	return ret;
}

#endif
SQLRETURN SQL_API SQLColumnPrivileges( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLCHAR           *szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLCHAR           *szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLCHAR           *szTableName, SQLSMALLINT        cchTableName, __in_ecount_opt(cchColumnName) SQLCHAR           *szColumnName, SQLSMALLINT        cchColumnName)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLColumnPrivileges(hstmt, szCatalogName, cchCatalogName, szSchemaName, cchSchemaName, szTableName, cchTableName, szColumnName, cchColumnName);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLCHAR(szCatalogName);
	wchar_t* arg3 = formatSQLSMALLINT(cchCatalogName);
	wchar_t* arg4 = formatSQLCHAR(szSchemaName);
	wchar_t* arg5 = formatSQLSMALLINT(cchSchemaName);
	wchar_t* arg6 = formatSQLCHAR(szTableName);
	wchar_t* arg7 = formatSQLSMALLINT(cchTableName);
	wchar_t* arg8 = formatSQLCHAR(szColumnName);
	wchar_t* arg9 = formatSQLSMALLINT(cchColumnName);
	log_odbc_call(L"SQLColumnPrivileges", ret, &tvStart, &tvEnd, 9, L"SQLHSTMT", L"hstmt", arg1, L"SQLCHAR*", L"szCatalogName", arg2, L"SQLSMALLINT", L"cchCatalogName", arg3, L"SQLCHAR*", L"szSchemaName", arg4, L"SQLSMALLINT", L"cchSchemaName", arg5, L"SQLCHAR*", L"szTableName", arg6, L"SQLSMALLINT", L"cchTableName", arg7, L"SQLCHAR*", L"szColumnName", arg8, L"SQLSMALLINT", L"cchColumnName", arg9);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	delete [] arg8;
	delete [] arg9;
	return ret;
}

SQLRETURN SQL_API SQLColumnPrivilegesW( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLWCHAR*    szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLWCHAR*     szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLWCHAR*      szTableName, SQLSMALLINT        cchTableName, __in_ecount_opt(cchColumnName) SQLWCHAR*     szColumnName, SQLSMALLINT        cchColumnName )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLColumnPrivilegesW(hstmt, szCatalogName, cchCatalogName, szSchemaName, cchSchemaName, szTableName, cchTableName, szColumnName, cchColumnName);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLWCHAR(szCatalogName);
	wchar_t* arg3 = formatSQLSMALLINT(cchCatalogName);
	wchar_t* arg4 = formatSQLWCHAR(szSchemaName);
	wchar_t* arg5 = formatSQLSMALLINT(cchSchemaName);
	wchar_t* arg6 = formatSQLWCHAR(szTableName);
	wchar_t* arg7 = formatSQLSMALLINT(cchTableName);
	wchar_t* arg8 = formatSQLWCHAR(szColumnName);
	wchar_t* arg9 = formatSQLSMALLINT(cchColumnName);
	log_odbc_call(L"SQLColumnPrivilegesW", ret, &tvStart, &tvEnd, 9, L"SQLHSTMT", L"hstmt", arg1, L"SQLWCHAR*", L"szCatalogName", arg2, L"SQLSMALLINT", L"cchCatalogName", arg3, L"SQLWCHAR*", L"szSchemaName", arg4, L"SQLSMALLINT", L"cchSchemaName", arg5, L"SQLWCHAR*", L"szTableName", arg6, L"SQLSMALLINT", L"cchTableName", arg7, L"SQLWCHAR*", L"szColumnName", arg8, L"SQLSMALLINT", L"cchColumnName", arg9);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	delete [] arg8;
	delete [] arg9;
	return ret;
}

SQLRETURN SQL_API SQLColumns(SQLHSTMT StatementHandle, __in_ecount_opt(NameLength1) SQLCHAR *CatalogName, SQLSMALLINT NameLength1, __in_ecount_opt(NameLength2) SQLCHAR *SchemaName, SQLSMALLINT NameLength2, __in_ecount_opt(NameLength3) SQLCHAR *TableName, SQLSMALLINT NameLength3, __in_ecount_opt(NameLength4) SQLCHAR *ColumnName, SQLSMALLINT NameLength4)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLColumns(StatementHandle, CatalogName, NameLength1, SchemaName, NameLength2, TableName, NameLength3, ColumnName, NameLength4);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(StatementHandle);
	wchar_t* arg2 = formatSQLCHAR(CatalogName);
	wchar_t* arg3 = formatSQLSMALLINT(NameLength1);
	wchar_t* arg4 = formatSQLCHAR(SchemaName);
	wchar_t* arg5 = formatSQLSMALLINT(NameLength2);
	wchar_t* arg6 = formatSQLCHAR(TableName);
	wchar_t* arg7 = formatSQLSMALLINT(NameLength3);
	wchar_t* arg8 = formatSQLCHAR(ColumnName);
	wchar_t* arg9 = formatSQLSMALLINT(NameLength4);
	log_odbc_call(L"SQLColumns", ret, &tvStart, &tvEnd, 9, L"SQLHSTMT", L"StatementHandle", arg1, L"SQLCHAR*", L"CatalogName", arg2, L"SQLSMALLINT", L"NameLength1", arg3, L"SQLCHAR*", L"SchemaName", arg4, L"SQLSMALLINT", L"NameLength2", arg5, L"SQLCHAR*", L"TableName", arg6, L"SQLSMALLINT", L"NameLength3", arg7, L"SQLCHAR*", L"ColumnName", arg8, L"SQLSMALLINT", L"NameLength4", arg9);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	delete [] arg8;
	delete [] arg9;
	return ret;
}

SQLRETURN SQL_API SQLColumnsW ( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLWCHAR*    szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLWCHAR*     szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLWCHAR*      szTableName, SQLSMALLINT        cchTableName, __in_ecount_opt(cchColumnName) SQLWCHAR*     szColumnName, SQLSMALLINT        cchColumnName )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLColumnsW (hstmt, szCatalogName, cchCatalogName, szSchemaName, cchSchemaName, szTableName, cchTableName, szColumnName, cchColumnName);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLWCHAR(szCatalogName);
	wchar_t* arg3 = formatSQLSMALLINT(cchCatalogName);
	wchar_t* arg4 = formatSQLWCHAR(szSchemaName);
	wchar_t* arg5 = formatSQLSMALLINT(cchSchemaName);
	wchar_t* arg6 = formatSQLWCHAR(szTableName);
	wchar_t* arg7 = formatSQLSMALLINT(cchTableName);
	wchar_t* arg8 = formatSQLWCHAR(szColumnName);
	wchar_t* arg9 = formatSQLSMALLINT(cchColumnName);
	log_odbc_call(L"SQLColumnsW ", ret, &tvStart, &tvEnd, 9, L"SQLHSTMT", L"hstmt", arg1, L"SQLWCHAR*", L"szCatalogName", arg2, L"SQLSMALLINT", L"cchCatalogName", arg3, L"SQLWCHAR*", L"szSchemaName", arg4, L"SQLSMALLINT", L"cchSchemaName", arg5, L"SQLWCHAR*", L"szTableName", arg6, L"SQLSMALLINT", L"cchTableName", arg7, L"SQLWCHAR*", L"szColumnName", arg8, L"SQLSMALLINT", L"cchColumnName", arg9);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	delete [] arg8;
	delete [] arg9;
	return ret;
}

SQLRETURN SQL_API SQLConnect(SQLHDBC ConnectionHandle, __in_ecount(NameLength1) SQLCHAR *ServerName, SQLSMALLINT NameLength1, __in_ecount(NameLength2) SQLCHAR *UserName, SQLSMALLINT NameLength2, __in_ecount(NameLength3) SQLCHAR *Authentication, SQLSMALLINT NameLength3)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLConnect(ConnectionHandle, ServerName, NameLength1, UserName, NameLength2, Authentication, NameLength3);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHDBC(ConnectionHandle);
	wchar_t* arg2 = formatSQLCHAR(ServerName);
	wchar_t* arg3 = formatSQLSMALLINT(NameLength1);
	wchar_t* arg4 = formatSQLCHAR(UserName);
	wchar_t* arg5 = formatSQLSMALLINT(NameLength2);
	wchar_t* arg6 = formatSQLCHAR(Authentication);
	wchar_t* arg7 = formatSQLSMALLINT(NameLength3);
	log_odbc_call(L"SQLConnect", ret, &tvStart, &tvEnd, 7, L"SQLHDBC", L"ConnectionHandle", arg1, L"SQLCHAR*", L"ServerName", arg2, L"SQLSMALLINT", L"NameLength1", arg3, L"SQLCHAR*", L"UserName", arg4, L"SQLSMALLINT", L"NameLength2", arg5, L"SQLCHAR*", L"Authentication", arg6, L"SQLSMALLINT", L"NameLength3", arg7);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	return ret;
}

SQLRETURN SQL_API SQLConnectW ( SQLHDBC             hdbc, __in_ecount(cchDSN) SQLWCHAR* szDSN, SQLSMALLINT         cchDSN, __in_ecount(cchUID) SQLWCHAR* szUID, SQLSMALLINT         cchUID, __in_ecount(cchAuthStr) SQLWCHAR* szAuthStr, SQLSMALLINT         cchAuthStr )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLConnectW (hdbc, szDSN, cchDSN, szUID, cchUID, szAuthStr, cchAuthStr);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHDBC(hdbc);
	wchar_t* arg2 = formatSQLWCHAR(szDSN);
	wchar_t* arg3 = formatSQLSMALLINT(cchDSN);
	wchar_t* arg4 = formatSQLWCHAR(szUID);
	wchar_t* arg5 = formatSQLSMALLINT(cchUID);
	wchar_t* arg6 = formatSQLWCHAR(szAuthStr);
	wchar_t* arg7 = formatSQLSMALLINT(cchAuthStr);
	log_odbc_call(L"SQLConnectW ", ret, &tvStart, &tvEnd, 7, L"SQLHDBC", L"hdbc", arg1, L"SQLWCHAR*", L"szDSN", arg2, L"SQLSMALLINT", L"cchDSN", arg3, L"SQLWCHAR*", L"szUID", arg4, L"SQLSMALLINT", L"cchUID", arg5, L"SQLWCHAR*", L"szAuthStr", arg6, L"SQLSMALLINT", L"cchAuthStr", arg7);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	return ret;
}

SQLRETURN SQL_API SQLCopyDesc(SQLHDESC SourceDescHandle, SQLHDESC TargetDescHandle)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLCopyDesc(SourceDescHandle, TargetDescHandle);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHDESC(SourceDescHandle);
	wchar_t* arg2 = formatSQLHDESC(TargetDescHandle);
	log_odbc_call(L"SQLCopyDesc", ret, &tvStart, &tvEnd, 2, L"SQLHDESC", L"SourceDescHandle", arg1, L"SQLHDESC", L"TargetDescHandle", arg2);
	delete [] arg1;
	delete [] arg2;
	return ret;
}

SQLRETURN SQL_API SQLDescribeCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, __out_ecount_opt(BufferLength) SQLCHAR *ColumnName, SQLSMALLINT BufferLength, __out_opt SQLSMALLINT *NameLength, __out_opt SQLSMALLINT *DataType, __out_opt SQLULEN *ColumnSize, __out_opt SQLSMALLINT *DecimalDigits, __out_opt SQLSMALLINT *Nullable)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLDescribeCol(StatementHandle, ColumnNumber, ColumnName, BufferLength, NameLength, DataType, ColumnSize, DecimalDigits, Nullable);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(StatementHandle);
	wchar_t* arg2 = formatSQLUSMALLINT(ColumnNumber);
	wchar_t* arg3 = formatSQLCHAR(ColumnName);
	wchar_t* arg4 = formatSQLSMALLINT(BufferLength);
	wchar_t* arg5 = formatPointer((void*)NameLength);
	wchar_t* arg6 = formatPointer((void*)DataType);
	wchar_t* arg7 = formatPointer((void*)ColumnSize);
	wchar_t* arg8 = formatPointer((void*)DecimalDigits);
	wchar_t* arg9 = formatPointer((void*)Nullable);
	log_odbc_call(L"SQLDescribeCol", ret, &tvStart, &tvEnd, 9, L"SQLHSTMT", L"StatementHandle", arg1, L"SQLUSMALLINT", L"ColumnNumber", arg2, L"SQLCHAR*", L"ColumnName", arg3, L"SQLSMALLINT", L"BufferLength", arg4, L"SQLSMALLINT*", L"NameLength", arg5, L"SQLSMALLINT*", L"DataType", arg6, L"SQLULEN*", L"ColumnSize", arg7, L"SQLSMALLINT*", L"DecimalDigits", arg8, L"SQLSMALLINT*", L"Nullable", arg9);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	delete [] arg8;
	delete [] arg9;
	return ret;
}

SQLRETURN SQL_API SQLDescribeColW ( SQLHSTMT            hstmt, SQLUSMALLINT        icol, __out_ecount_opt(cchColNameMax) SQLWCHAR* szColName, SQLSMALLINT         cchColNameMax, __out_opt SQLSMALLINT*        pcchColName, __out_opt SQLSMALLINT*        pfSqlType, __out_opt SQLULEN*            pcbColDef, __out_opt SQLSMALLINT*        pibScale, __out_opt SQLSMALLINT*        pfNullable )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLDescribeColW (hstmt, icol, szColName, cchColNameMax, pcchColName, pfSqlType, pcbColDef, pibScale, pfNullable);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLUSMALLINT(icol);
	wchar_t* arg3 = formatSQLWCHAR(szColName);
	wchar_t* arg4 = formatSQLSMALLINT(cchColNameMax);
	wchar_t* arg5 = formatPointer((void*)pcchColName);
	wchar_t* arg6 = formatPointer((void*)pfSqlType);
	wchar_t* arg7 = formatPointer((void*)pcbColDef);
	wchar_t* arg8 = formatPointer((void*)pibScale);
	wchar_t* arg9 = formatPointer((void*)pfNullable);
	log_odbc_call(L"SQLDescribeColW ", ret, &tvStart, &tvEnd, 9, L"SQLHSTMT", L"hstmt", arg1, L"SQLUSMALLINT", L"icol", arg2, L"SQLWCHAR*", L"szColName", arg3, L"SQLSMALLINT", L"cchColNameMax", arg4, L"SQLSMALLINT*", L"pcchColName", arg5, L"SQLSMALLINT*", L"pfSqlType", arg6, L"SQLULEN*", L"pcbColDef", arg7, L"SQLSMALLINT*", L"pibScale", arg8, L"SQLSMALLINT*", L"pfNullable", arg9);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	delete [] arg8;
	delete [] arg9;
	return ret;
}

SQLRETURN SQL_API SQLDescribeParam( SQLHSTMT           hstmt, SQLUSMALLINT       ipar, __out_opt SQLSMALLINT       *pfSqlType, __out_opt SQLULEN           *pcbParamDef, __out_opt SQLSMALLINT       *pibScale, __out_opt SQLSMALLINT       *pfNullable)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLDescribeParam(hstmt, ipar, pfSqlType, pcbParamDef, pibScale, pfNullable);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLUSMALLINT(ipar);
	wchar_t* arg3 = formatPointer((void*)pfSqlType);
	wchar_t* arg4 = formatPointer((void*)pcbParamDef);
	wchar_t* arg5 = formatPointer((void*)pibScale);
	wchar_t* arg6 = formatPointer((void*)pfNullable);
	log_odbc_call(L"SQLDescribeParam", ret, &tvStart, &tvEnd, 6, L"SQLHSTMT", L"hstmt", arg1, L"SQLUSMALLINT", L"ipar", arg2, L"SQLSMALLINT*", L"pfSqlType", arg3, L"SQLULEN*", L"pcbParamDef", arg4, L"SQLSMALLINT*", L"pibScale", arg5, L"SQLSMALLINT*", L"pfNullable", arg6);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	return ret;
}

SQLRETURN SQL_API SQLDisconnect(SQLHDBC ConnectionHandle)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLDisconnect(ConnectionHandle);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHDBC(ConnectionHandle);
	log_odbc_call(L"SQLDisconnect", ret, &tvStart, &tvEnd, 1, L"SQLHDBC", L"ConnectionHandle", arg1);
	delete [] arg1;
	return ret;
}

SQLRETURN SQL_API SQLDriverConnect( SQLHDBC            hdbc, SQLHWND            hwnd, __in_ecount(cchConnStrIn) SQLCHAR           *szConnStrIn, SQLSMALLINT        cchConnStrIn, __out_ecount_opt(cchConnStrOutMax) SQLCHAR           *szConnStrOut, SQLSMALLINT        cchConnStrOutMax, __out_opt SQLSMALLINT       *pcchConnStrOut, SQLUSMALLINT       fDriverCompletion)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLDriverConnect(hdbc, hwnd, szConnStrIn, cchConnStrIn, szConnStrOut, cchConnStrOutMax, pcchConnStrOut, fDriverCompletion);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHDBC(hdbc);
	wchar_t* arg2 = formatSQLHWND(hwnd);
	wchar_t* arg3 = formatSQLCHAR(szConnStrIn);
	wchar_t* arg4 = formatSQLSMALLINT(cchConnStrIn);
	wchar_t* arg5 = formatSQLCHAR(szConnStrOut);
	wchar_t* arg6 = formatSQLSMALLINT(cchConnStrOutMax);
	wchar_t* arg7 = formatPointer((void*)pcchConnStrOut);
	wchar_t* arg8 = formatSQLUSMALLINT(fDriverCompletion);
	log_odbc_call(L"SQLDriverConnect", ret, &tvStart, &tvEnd, 8, L"SQLHDBC", L"hdbc", arg1, L"SQLHWND", L"hwnd", arg2, L"SQLCHAR*", L"szConnStrIn", arg3, L"SQLSMALLINT", L"cchConnStrIn", arg4, L"SQLCHAR*", L"szConnStrOut", arg5, L"SQLSMALLINT", L"cchConnStrOutMax", arg6, L"SQLSMALLINT*", L"pcchConnStrOut", arg7, L"SQLUSMALLINT", L"fDriverCompletion", arg8);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	delete [] arg8;
	return ret;
}

SQLRETURN SQL_API SQLDriverConnectW ( SQLHDBC             hdbc, SQLHWND             hwnd, __in_ecount(cchConnStrIn) SQLWCHAR* szConnStrIn, SQLSMALLINT         cchConnStrIn, __out_ecount_opt(cchConnStrOutMax) SQLWCHAR* szConnStrOut, SQLSMALLINT         cchConnStrOutMax, __out_opt SQLSMALLINT*        pcchConnStrOut, SQLUSMALLINT        fDriverCompletion )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLDriverConnectW (hdbc, hwnd, szConnStrIn, cchConnStrIn, szConnStrOut, cchConnStrOutMax, pcchConnStrOut, fDriverCompletion);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHDBC(hdbc);
	wchar_t* arg2 = formatSQLHWND(hwnd);
	wchar_t* arg3 = formatSQLWCHAR(szConnStrIn);
	wchar_t* arg4 = formatSQLSMALLINT(cchConnStrIn);
	wchar_t* arg5 = formatSQLWCHAR(szConnStrOut);
	wchar_t* arg6 = formatSQLSMALLINT(cchConnStrOutMax);
	wchar_t* arg7 = formatPointer((void*)pcchConnStrOut);
	wchar_t* arg8 = formatSQLUSMALLINT(fDriverCompletion);
	log_odbc_call(L"SQLDriverConnectW ", ret, &tvStart, &tvEnd, 8, L"SQLHDBC", L"hdbc", arg1, L"SQLHWND", L"hwnd", arg2, L"SQLWCHAR*", L"szConnStrIn", arg3, L"SQLSMALLINT", L"cchConnStrIn", arg4, L"SQLWCHAR*", L"szConnStrOut", arg5, L"SQLSMALLINT", L"cchConnStrOutMax", arg6, L"SQLSMALLINT*", L"pcchConnStrOut", arg7, L"SQLUSMALLINT", L"fDriverCompletion", arg8);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	delete [] arg8;
	return ret;
}

SQLRETURN SQL_API SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT CompletionType)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLEndTran(HandleType, Handle, CompletionType);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLSMALLINT(HandleType);
	wchar_t* arg2 = formatSQLHANDLE(Handle);
	wchar_t* arg3 = formatSQLSMALLINT(CompletionType);
	log_odbc_call(L"SQLEndTran", ret, &tvStart, &tvEnd, 3, L"SQLSMALLINT", L"HandleType", arg1, L"SQLHANDLE", L"Handle", arg2, L"SQLSMALLINT", L"CompletionType", arg3);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	return ret;
}

SQLRETURN SQL_API SQLExecDirect ( SQLHSTMT StatementHandle, __in_ecount_opt(TextLength) SQLCHAR* StatementText, SQLINTEGER TextLength )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLExecDirect (StatementHandle, StatementText, TextLength);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(StatementHandle);
	wchar_t* arg2 = formatSQLCHAR(StatementText);
	wchar_t* arg3 = formatSQLINTEGER(TextLength);
	log_odbc_call(L"SQLExecDirect ", ret, &tvStart, &tvEnd, 3, L"SQLHSTMT", L"StatementHandle", arg1, L"SQLCHAR*", L"StatementText", arg2, L"SQLINTEGER", L"TextLength", arg3);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	return ret;
}

SQLRETURN SQL_API SQLExecDirectW ( SQLHSTMT    hstmt, __in_ecount_opt(TextLength) SQLWCHAR* szSqlStr, SQLINTEGER  TextLength )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLExecDirectW (hstmt, szSqlStr, TextLength);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLWCHAR(szSqlStr);
	wchar_t* arg3 = formatSQLINTEGER(TextLength);
	log_odbc_call(L"SQLExecDirectW ", ret, &tvStart, &tvEnd, 3, L"SQLHSTMT", L"hstmt", arg1, L"SQLWCHAR*", L"szSqlStr", arg2, L"SQLINTEGER", L"TextLength", arg3);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	return ret;
}

SQLRETURN SQL_API SQLExecute(SQLHSTMT StatementHandle)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLExecute(StatementHandle);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(StatementHandle);
	log_odbc_call(L"SQLExecute", ret, &tvStart, &tvEnd, 1, L"SQLHSTMT", L"StatementHandle", arg1);
	delete [] arg1;
	return ret;
}

SQLRETURN SQL_API SQLFetch(SQLHSTMT StatementHandle)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLFetch(StatementHandle);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(StatementHandle);
	log_odbc_call(L"SQLFetch", ret, &tvStart, &tvEnd, 1, L"SQLHSTMT", L"StatementHandle", arg1);
	delete [] arg1;
	return ret;
}

SQLRETURN SQL_API SQLFetchScroll(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrientation, SQLLEN FetchOffset)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLFetchScroll(StatementHandle, FetchOrientation, FetchOffset);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(StatementHandle);
	wchar_t* arg2 = formatSQLSMALLINT(FetchOrientation);
	wchar_t* arg3 = formatSQLLEN(FetchOffset);
	log_odbc_call(L"SQLFetchScroll", ret, &tvStart, &tvEnd, 3, L"SQLHSTMT", L"StatementHandle", arg1, L"SQLSMALLINT", L"FetchOrientation", arg2, L"SQLLEN", L"FetchOffset", arg3);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	return ret;
}

SQLRETURN SQL_API SQLForeignKeys( SQLHSTMT           hstmt, __in_ecount_opt(cchPkCatalogName) SQLCHAR           *szPkCatalogName, SQLSMALLINT        cchPkCatalogName, __in_ecount_opt(cchPkSchemaName) SQLCHAR           *szPkSchemaName, SQLSMALLINT        cchPkSchemaName, __in_ecount_opt(cchPkTableName) SQLCHAR           *szPkTableName, SQLSMALLINT        cchPkTableName, __in_ecount_opt(cchFkCatalogName) SQLCHAR           *szFkCatalogName, SQLSMALLINT        cchFkCatalogName, __in_ecount_opt(cchFkSchemaName) SQLCHAR           *szFkSchemaName, SQLSMALLINT        cchFkSchemaName, __in_ecount_opt(cchFkTableName) SQLCHAR           *szFkTableName, SQLSMALLINT        cchFkTableName)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLForeignKeys(hstmt, szPkCatalogName, cchPkCatalogName, szPkSchemaName, cchPkSchemaName, szPkTableName, cchPkTableName, szFkCatalogName, cchFkCatalogName, szFkSchemaName, cchFkSchemaName, szFkTableName, cchFkTableName);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLCHAR(szPkCatalogName);
	wchar_t* arg3 = formatSQLSMALLINT(cchPkCatalogName);
	wchar_t* arg4 = formatSQLCHAR(szPkSchemaName);
	wchar_t* arg5 = formatSQLSMALLINT(cchPkSchemaName);
	wchar_t* arg6 = formatSQLCHAR(szPkTableName);
	wchar_t* arg7 = formatSQLSMALLINT(cchPkTableName);
	wchar_t* arg8 = formatSQLCHAR(szFkCatalogName);
	wchar_t* arg9 = formatSQLSMALLINT(cchFkCatalogName);
	wchar_t* arg10 = formatSQLCHAR(szFkSchemaName);
	wchar_t* arg11 = formatSQLSMALLINT(cchFkSchemaName);
	wchar_t* arg12 = formatSQLCHAR(szFkTableName);
	wchar_t* arg13 = formatSQLSMALLINT(cchFkTableName);
	log_odbc_call(L"SQLForeignKeys", ret, &tvStart, &tvEnd, 13, L"SQLHSTMT", L"hstmt", arg1, L"SQLCHAR*", L"szPkCatalogName", arg2, L"SQLSMALLINT", L"cchPkCatalogName", arg3, L"SQLCHAR*", L"szPkSchemaName", arg4, L"SQLSMALLINT", L"cchPkSchemaName", arg5, L"SQLCHAR*", L"szPkTableName", arg6, L"SQLSMALLINT", L"cchPkTableName", arg7, L"SQLCHAR*", L"szFkCatalogName", arg8, L"SQLSMALLINT", L"cchFkCatalogName", arg9, L"SQLCHAR*", L"szFkSchemaName", arg10, L"SQLSMALLINT", L"cchFkSchemaName", arg11, L"SQLCHAR*", L"szFkTableName", arg12, L"SQLSMALLINT", L"cchFkTableName", arg13);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	delete [] arg8;
	delete [] arg9;
	delete [] arg10;
	delete [] arg11;
	delete [] arg12;
	delete [] arg13;
	return ret;
}

SQLRETURN SQL_API SQLForeignKeysW ( SQLHSTMT           hstmt, __in_ecount_opt(cchPkCatalogName) SQLWCHAR*    szPkCatalogName, SQLSMALLINT        cchPkCatalogName, __in_ecount_opt(cchPkSchemaName) SQLWCHAR*     szPkSchemaName, SQLSMALLINT        cchPkSchemaName, __in_ecount_opt(cchPkTableName) SQLWCHAR*      szPkTableName, SQLSMALLINT        cchPkTableName, __in_ecount_opt(cchFkCatalogName) SQLWCHAR*    szFkCatalogName, SQLSMALLINT        cchFkCatalogName, __in_ecount_opt(cchFkSchemaName) SQLWCHAR*     szFkSchemaName, SQLSMALLINT        cchFkSchemaName, __in_ecount_opt(cchFkTableName) SQLWCHAR*      szFkTableName, SQLSMALLINT        cchFkTableName )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLForeignKeysW (hstmt, szPkCatalogName, cchPkCatalogName, szPkSchemaName, cchPkSchemaName, szPkTableName, cchPkTableName, szFkCatalogName, cchFkCatalogName, szFkSchemaName, cchFkSchemaName, szFkTableName, cchFkTableName);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLWCHAR(szPkCatalogName);
	wchar_t* arg3 = formatSQLSMALLINT(cchPkCatalogName);
	wchar_t* arg4 = formatSQLWCHAR(szPkSchemaName);
	wchar_t* arg5 = formatSQLSMALLINT(cchPkSchemaName);
	wchar_t* arg6 = formatSQLWCHAR(szPkTableName);
	wchar_t* arg7 = formatSQLSMALLINT(cchPkTableName);
	wchar_t* arg8 = formatSQLWCHAR(szFkCatalogName);
	wchar_t* arg9 = formatSQLSMALLINT(cchFkCatalogName);
	wchar_t* arg10 = formatSQLWCHAR(szFkSchemaName);
	wchar_t* arg11 = formatSQLSMALLINT(cchFkSchemaName);
	wchar_t* arg12 = formatSQLWCHAR(szFkTableName);
	wchar_t* arg13 = formatSQLSMALLINT(cchFkTableName);
	log_odbc_call(L"SQLForeignKeysW ", ret, &tvStart, &tvEnd, 13, L"SQLHSTMT", L"hstmt", arg1, L"SQLWCHAR*", L"szPkCatalogName", arg2, L"SQLSMALLINT", L"cchPkCatalogName", arg3, L"SQLWCHAR*", L"szPkSchemaName", arg4, L"SQLSMALLINT", L"cchPkSchemaName", arg5, L"SQLWCHAR*", L"szPkTableName", arg6, L"SQLSMALLINT", L"cchPkTableName", arg7, L"SQLWCHAR*", L"szFkCatalogName", arg8, L"SQLSMALLINT", L"cchFkCatalogName", arg9, L"SQLWCHAR*", L"szFkSchemaName", arg10, L"SQLSMALLINT", L"cchFkSchemaName", arg11, L"SQLWCHAR*", L"szFkTableName", arg12, L"SQLSMALLINT", L"cchFkTableName", arg13);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	delete [] arg8;
	delete [] arg9;
	delete [] arg10;
	delete [] arg11;
	delete [] arg12;
	delete [] arg13;
	return ret;
}

SQLRETURN SQL_API SQLFreeStmt(SQLHSTMT StatementHandle, SQLUSMALLINT Option)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLFreeStmt(StatementHandle, Option);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(StatementHandle);
	wchar_t* arg2 = formatSQLUSMALLINT(Option);
	log_odbc_call(L"SQLFreeStmt", ret, &tvStart, &tvEnd, 2, L"SQLHSTMT", L"StatementHandle", arg1, L"SQLUSMALLINT", L"Option", arg2);
	delete [] arg1;
	delete [] arg2;
	return ret;
}

SQLRETURN SQL_API SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLFreeHandle(HandleType, Handle);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLSMALLINT(HandleType);
	wchar_t* arg2 = formatSQLHANDLE(Handle);
	log_odbc_call(L"SQLFreeHandle", ret, &tvStart, &tvEnd, 2, L"SQLSMALLINT", L"HandleType", arg1, L"SQLHANDLE", L"Handle", arg2);
	delete [] arg1;
	delete [] arg2;
	return ret;
}

SQLRETURN SQL_API SQLGetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, __out_xcount_opt(BufferLength) SQLPOINTER Value, SQLINTEGER BufferLength, __out_opt SQLINTEGER *StringLengthPtr)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLGetConnectAttr(ConnectionHandle, Attribute, Value, BufferLength, StringLengthPtr);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHDBC(ConnectionHandle);
	wchar_t* arg2 = formatSQLINTEGER(Attribute);
	wchar_t* arg3 = formatSQLPOINTER(Value);
	wchar_t* arg4 = formatSQLINTEGER(BufferLength);
	wchar_t* arg5 = formatPointer((void*)StringLengthPtr);
	log_odbc_call(L"SQLGetConnectAttr", ret, &tvStart, &tvEnd, 5, L"SQLHDBC", L"ConnectionHandle", arg1, L"SQLINTEGER", L"Attribute", arg2, L"SQLPOINTER", L"Value", arg3, L"SQLINTEGER", L"BufferLength", arg4, L"SQLINTEGER*", L"StringLengthPtr", arg5);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	return ret;
}

SQLRETURN SQL_API SQLGetConnectAttrW ( SQLHDBC     hdbc, SQLINTEGER  fAttribute, __out_xcount_opt(cbValueMax) SQLPOINTER  rgbValue, SQLINTEGER  cbValueMax, __out_opt SQLINTEGER* pcbValue )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLGetConnectAttrW (hdbc, fAttribute, rgbValue, cbValueMax, pcbValue);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHDBC(hdbc);
	wchar_t* arg2 = formatSQLINTEGER(fAttribute);
	wchar_t* arg3 = formatSQLPOINTER(rgbValue);
	wchar_t* arg4 = formatSQLINTEGER(cbValueMax);
	wchar_t* arg5 = formatPointer((void*)pcbValue);
	log_odbc_call(L"SQLGetConnectAttrW ", ret, &tvStart, &tvEnd, 5, L"SQLHDBC", L"hdbc", arg1, L"SQLINTEGER", L"fAttribute", arg2, L"SQLPOINTER", L"rgbValue", arg3, L"SQLINTEGER", L"cbValueMax", arg4, L"SQLINTEGER*", L"pcbValue", arg5);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	return ret;
}

SQLRETURN SQL_API SQLGetCursorName ( SQLHSTMT StatementHandle, __out_ecount_opt(BufferLength) SQLCHAR *CursorName, SQLSMALLINT BufferLength, __out_opt SQLSMALLINT *NameLengthPtr )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLGetCursorName (StatementHandle, CursorName, BufferLength, NameLengthPtr);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(StatementHandle);
	wchar_t* arg2 = formatSQLCHAR(CursorName);
	wchar_t* arg3 = formatSQLSMALLINT(BufferLength);
	wchar_t* arg4 = formatPointer((void*)NameLengthPtr);
	log_odbc_call(L"SQLGetCursorName ", ret, &tvStart, &tvEnd, 4, L"SQLHSTMT", L"StatementHandle", arg1, L"SQLCHAR*", L"CursorName", arg2, L"SQLSMALLINT", L"BufferLength", arg3, L"SQLSMALLINT*", L"NameLengthPtr", arg4);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	return ret;
}

SQLRETURN SQL_API SQLGetCursorNameW ( SQLHSTMT        hstmt, __out_ecount_opt(cchCursorMax) SQLWCHAR* szCursor, SQLSMALLINT     cchCursorMax, __out_opt SQLSMALLINT*    pcchCursor )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLGetCursorNameW (hstmt, szCursor, cchCursorMax, pcchCursor);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLWCHAR(szCursor);
	wchar_t* arg3 = formatSQLSMALLINT(cchCursorMax);
	wchar_t* arg4 = formatPointer((void*)pcchCursor);
	log_odbc_call(L"SQLGetCursorNameW ", ret, &tvStart, &tvEnd, 4, L"SQLHSTMT", L"hstmt", arg1, L"SQLWCHAR*", L"szCursor", arg2, L"SQLSMALLINT", L"cchCursorMax", arg3, L"SQLSMALLINT*", L"pcchCursor", arg4);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	return ret;
}

SQLRETURN SQL_API SQLGetData(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, __out_xcount_opt(BufferLength) SQLPOINTER TargetValue, SQLLEN BufferLength, __out_opt SQLLEN *StrLen_or_IndPtr)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLGetData(StatementHandle, ColumnNumber, TargetType, TargetValue, BufferLength, StrLen_or_IndPtr);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(StatementHandle);
	wchar_t* arg2 = formatSQLUSMALLINT(ColumnNumber);
	wchar_t* arg3 = formatSQLSMALLINT(TargetType);
	wchar_t* arg4 = formatSQLPOINTER(TargetValue);
	wchar_t* arg5 = formatSQLLEN(BufferLength);
	wchar_t* arg6 = formatPointer((void*)StrLen_or_IndPtr);
	log_odbc_call(L"SQLGetData", ret, &tvStart, &tvEnd, 6, L"SQLHSTMT", L"StatementHandle", arg1, L"SQLUSMALLINT", L"ColumnNumber", arg2, L"SQLSMALLINT", L"TargetType", arg3, L"SQLPOINTER", L"TargetValue", arg4, L"SQLLEN", L"BufferLength", arg5, L"SQLLEN*", L"StrLen_or_IndPtr", arg6);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	return ret;
}

SQLRETURN SQL_API SQLGetDescField(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, __out_xcount_opt(BufferLength) SQLPOINTER Value, SQLINTEGER BufferLength, __out_opt SQLINTEGER *StringLength)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLGetDescField(DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength, StringLength);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHDESC(DescriptorHandle);
	wchar_t* arg2 = formatSQLSMALLINT(RecNumber);
	wchar_t* arg3 = formatSQLSMALLINT(FieldIdentifier);
	wchar_t* arg4 = formatSQLPOINTER(Value);
	wchar_t* arg5 = formatSQLINTEGER(BufferLength);
	wchar_t* arg6 = formatPointer((void*)StringLength);
	log_odbc_call(L"SQLGetDescField", ret, &tvStart, &tvEnd, 6, L"SQLHDESC", L"DescriptorHandle", arg1, L"SQLSMALLINT", L"RecNumber", arg2, L"SQLSMALLINT", L"FieldIdentifier", arg3, L"SQLPOINTER", L"Value", arg4, L"SQLINTEGER", L"BufferLength", arg5, L"SQLINTEGER*", L"StringLength", arg6);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	return ret;
}

SQLRETURN SQL_API SQLGetDescFieldW ( SQLHDESC        hdesc, SQLSMALLINT     iRecord, SQLSMALLINT     iField, __out_xcount_opt(cbBufferLength) SQLPOINTER      rgbValue, SQLINTEGER      cbBufferLength, __out_opt SQLINTEGER      *StringLength )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLGetDescFieldW (hdesc, iRecord, iField, rgbValue, cbBufferLength, StringLength);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHDESC(hdesc);
	wchar_t* arg2 = formatSQLSMALLINT(iRecord);
	wchar_t* arg3 = formatSQLSMALLINT(iField);
	wchar_t* arg4 = formatSQLPOINTER(rgbValue);
	wchar_t* arg5 = formatSQLINTEGER(cbBufferLength);
	wchar_t* arg6 = formatPointer((void*)StringLength);
	log_odbc_call(L"SQLGetDescFieldW ", ret, &tvStart, &tvEnd, 6, L"SQLHDESC", L"hdesc", arg1, L"SQLSMALLINT", L"iRecord", arg2, L"SQLSMALLINT", L"iField", arg3, L"SQLPOINTER", L"rgbValue", arg4, L"SQLINTEGER", L"cbBufferLength", arg5, L"SQLINTEGER*", L"StringLength", arg6);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	return ret;
}

SQLRETURN SQL_API SQLGetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, __out_ecount_opt(BufferLength) SQLCHAR *Name, SQLSMALLINT BufferLength, __out_opt SQLSMALLINT *StringLengthPtr, __out_opt SQLSMALLINT *TypePtr, __out_opt SQLSMALLINT *SubTypePtr, __out_opt SQLLEN     *LengthPtr, __out_opt SQLSMALLINT *PrecisionPtr, __out_opt SQLSMALLINT *ScalePtr, __out_opt SQLSMALLINT *NullablePtr)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLGetDescRec(DescriptorHandle, RecNumber, Name, BufferLength, StringLengthPtr, TypePtr, SubTypePtr, LengthPtr, PrecisionPtr, ScalePtr, NullablePtr);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHDESC(DescriptorHandle);
	wchar_t* arg2 = formatSQLSMALLINT(RecNumber);
	wchar_t* arg3 = formatSQLCHAR(Name);
	wchar_t* arg4 = formatSQLSMALLINT(BufferLength);
	wchar_t* arg5 = formatPointer((void*)StringLengthPtr);
	wchar_t* arg6 = formatPointer((void*)TypePtr);
	wchar_t* arg7 = formatPointer((void*)SubTypePtr);
	wchar_t* arg8 = formatPointer((void*)LengthPtr);
	wchar_t* arg9 = formatPointer((void*)PrecisionPtr);
	wchar_t* arg10 = formatPointer((void*)ScalePtr);
	wchar_t* arg11 = formatPointer((void*)NullablePtr);
	log_odbc_call(L"SQLGetDescRec", ret, &tvStart, &tvEnd, 11, L"SQLHDESC", L"DescriptorHandle", arg1, L"SQLSMALLINT", L"RecNumber", arg2, L"SQLCHAR*", L"Name", arg3, L"SQLSMALLINT", L"BufferLength", arg4, L"SQLSMALLINT*", L"StringLengthPtr", arg5, L"SQLSMALLINT*", L"TypePtr", arg6, L"SQLSMALLINT*", L"SubTypePtr", arg7, L"SQLLEN*", L"LengthPtr", arg8, L"SQLSMALLINT*", L"PrecisionPtr", arg9, L"SQLSMALLINT*", L"ScalePtr", arg10, L"SQLSMALLINT*", L"NullablePtr", arg11);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	delete [] arg8;
	delete [] arg9;
	delete [] arg10;
	delete [] arg11;
	return ret;
}

SQLRETURN SQL_API SQLGetDescRecW ( SQLHDESC        hdesc, SQLSMALLINT     iRecord, __out_ecount_opt(cchNameMax) SQLWCHAR* szName, SQLSMALLINT     cchNameMax, __out_opt SQLSMALLINT     *pcchName, __out_opt SQLSMALLINT     *pfType, __out_opt SQLSMALLINT     *pfSubType, __out_opt SQLLEN          *pLength, __out_opt SQLSMALLINT     *pPrecision, __out_opt SQLSMALLINT     *pScale, __out_opt SQLSMALLINT     *pNullable )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLGetDescRecW (hdesc, iRecord, szName, cchNameMax, pcchName, pfType, pfSubType, pLength, pPrecision, pScale, pNullable);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHDESC(hdesc);
	wchar_t* arg2 = formatSQLSMALLINT(iRecord);
	wchar_t* arg3 = formatSQLWCHAR(szName);
	wchar_t* arg4 = formatSQLSMALLINT(cchNameMax);
	wchar_t* arg5 = formatPointer((void*)pcchName);
	wchar_t* arg6 = formatPointer((void*)pfType);
	wchar_t* arg7 = formatPointer((void*)pfSubType);
	wchar_t* arg8 = formatPointer((void*)pLength);
	wchar_t* arg9 = formatPointer((void*)pPrecision);
	wchar_t* arg10 = formatPointer((void*)pScale);
	wchar_t* arg11 = formatPointer((void*)pNullable);
	log_odbc_call(L"SQLGetDescRecW ", ret, &tvStart, &tvEnd, 11, L"SQLHDESC", L"hdesc", arg1, L"SQLSMALLINT", L"iRecord", arg2, L"SQLWCHAR*", L"szName", arg3, L"SQLSMALLINT", L"cchNameMax", arg4, L"SQLSMALLINT*", L"pcchName", arg5, L"SQLSMALLINT*", L"pfType", arg6, L"SQLSMALLINT*", L"pfSubType", arg7, L"SQLLEN*", L"pLength", arg8, L"SQLSMALLINT*", L"pPrecision", arg9, L"SQLSMALLINT*", L"pScale", arg10, L"SQLSMALLINT*", L"pNullable", arg11);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	delete [] arg8;
	delete [] arg9;
	delete [] arg10;
	delete [] arg11;
	return ret;
}

SQLRETURN SQL_API SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier, __out_xcount_opt(BufferLength) SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, __out_opt SQLSMALLINT *StringLength)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLGetDiagField(HandleType, Handle, RecNumber, DiagIdentifier, DiagInfo, BufferLength, StringLength);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLSMALLINT(HandleType);
	wchar_t* arg2 = formatSQLHANDLE(Handle);
	wchar_t* arg3 = formatSQLSMALLINT(RecNumber);
	wchar_t* arg4 = formatSQLSMALLINT(DiagIdentifier);
	wchar_t* arg5 = formatSQLPOINTER(DiagInfo);
	wchar_t* arg6 = formatSQLSMALLINT(BufferLength);
	wchar_t* arg7 = formatPointer((void*)StringLength);
	log_odbc_call(L"SQLGetDiagField", ret, &tvStart, &tvEnd, 7, L"SQLSMALLINT", L"HandleType", arg1, L"SQLHANDLE", L"Handle", arg2, L"SQLSMALLINT", L"RecNumber", arg3, L"SQLSMALLINT", L"DiagIdentifier", arg4, L"SQLPOINTER", L"DiagInfo", arg5, L"SQLSMALLINT", L"BufferLength", arg6, L"SQLSMALLINT*", L"StringLength", arg7);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	return ret;
}

SQLRETURN SQL_API SQLGetDiagFieldW ( SQLSMALLINT     fHandleType, SQLHANDLE       handle, SQLSMALLINT     iRecord, SQLSMALLINT     fDiagField, __out_xcount_opt(cbBufferLength) SQLPOINTER      rgbDiagInfo, SQLSMALLINT     cbBufferLength, __out_opt SQLSMALLINT     *pcbStringLength )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLGetDiagFieldW (fHandleType, handle, iRecord, fDiagField, rgbDiagInfo, cbBufferLength, pcbStringLength);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLSMALLINT(fHandleType);
	wchar_t* arg2 = formatSQLHANDLE(handle);
	wchar_t* arg3 = formatSQLSMALLINT(iRecord);
	wchar_t* arg4 = formatSQLSMALLINT(fDiagField);
	wchar_t* arg5 = formatSQLPOINTER(rgbDiagInfo);
	wchar_t* arg6 = formatSQLSMALLINT(cbBufferLength);
	wchar_t* arg7 = formatPointer((void*)pcbStringLength);
	log_odbc_call(L"SQLGetDiagFieldW ", ret, &tvStart, &tvEnd, 7, L"SQLSMALLINT", L"fHandleType", arg1, L"SQLHANDLE", L"handle", arg2, L"SQLSMALLINT", L"iRecord", arg3, L"SQLSMALLINT", L"fDiagField", arg4, L"SQLPOINTER", L"rgbDiagInfo", arg5, L"SQLSMALLINT", L"cbBufferLength", arg6, L"SQLSMALLINT*", L"pcbStringLength", arg7);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	return ret;
}

SQLRETURN SQL_API SQLGetDiagRec ( SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, __out_ecount_opt(6) SQLCHAR *Sqlstate, SQLINTEGER *NativeError, __out_ecount_opt(BufferLength) SQLCHAR* MessageText, SQLSMALLINT BufferLength, __out_opt SQLSMALLINT *TextLength )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLGetDiagRec (HandleType, Handle, RecNumber, Sqlstate, NativeError, MessageText, BufferLength, TextLength);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLSMALLINT(HandleType);
	wchar_t* arg2 = formatSQLHANDLE(Handle);
	wchar_t* arg3 = formatSQLSMALLINT(RecNumber);
	wchar_t* arg4 = formatSQLCHAR(Sqlstate);
	wchar_t* arg5 = formatPointer((void*)NativeError);
	wchar_t* arg6 = formatSQLCHAR(MessageText);
	wchar_t* arg7 = formatSQLSMALLINT(BufferLength);
	wchar_t* arg8 = formatPointer((void*)TextLength);
	log_odbc_call(L"SQLGetDiagRec ", ret, &tvStart, &tvEnd, 8, L"SQLSMALLINT", L"HandleType", arg1, L"SQLHANDLE", L"Handle", arg2, L"SQLSMALLINT", L"RecNumber", arg3, L"SQLCHAR*", L"Sqlstate", arg4, L"SQLINTEGER*", L"NativeError", arg5, L"SQLCHAR*", L"MessageText", arg6, L"SQLSMALLINT", L"BufferLength", arg7, L"SQLSMALLINT*", L"TextLength", arg8);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	delete [] arg8;
	return ret;
}

SQLRETURN SQL_API SQLGetDiagRecW ( SQLSMALLINT     fHandleType, SQLHANDLE       handle, SQLSMALLINT     iRecord, __out_ecount_opt(6) SQLWCHAR* szSqlState, SQLINTEGER*     pfNativeError, __out_ecount_opt(cchErrorMsgMax) SQLWCHAR* szErrorMsg, SQLSMALLINT     cchErrorMsgMax, SQLSMALLINT*    pcchErrorMsg )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLGetDiagRecW (fHandleType, handle, iRecord, szSqlState, pfNativeError, szErrorMsg, cchErrorMsgMax, pcchErrorMsg);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLSMALLINT(fHandleType);
	wchar_t* arg2 = formatSQLHANDLE(handle);
	wchar_t* arg3 = formatSQLSMALLINT(iRecord);
	wchar_t* arg4 = formatSQLWCHAR(szSqlState);
	wchar_t* arg5 = formatPointer((void*)pfNativeError);
	wchar_t* arg6 = formatSQLWCHAR(szErrorMsg);
	wchar_t* arg7 = formatSQLSMALLINT(cchErrorMsgMax);
	wchar_t* arg8 = formatPointer((void*)pcchErrorMsg);
	log_odbc_call(L"SQLGetDiagRecW ", ret, &tvStart, &tvEnd, 8, L"SQLSMALLINT", L"fHandleType", arg1, L"SQLHANDLE", L"handle", arg2, L"SQLSMALLINT", L"iRecord", arg3, L"SQLWCHAR*", L"szSqlState", arg4, L"SQLINTEGER*", L"pfNativeError", arg5, L"SQLWCHAR*", L"szErrorMsg", arg6, L"SQLSMALLINT", L"cchErrorMsgMax", arg7, L"SQLSMALLINT*", L"pcchErrorMsg", arg8);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	delete [] arg8;
	return ret;
}

SQLRETURN SQL_API SQLGetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, __out_xcount(BufferLength) SQLPOINTER Value, SQLINTEGER BufferLength, __out_opt SQLINTEGER *StringLength)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLGetEnvAttr(EnvironmentHandle, Attribute, Value, BufferLength, StringLength);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHENV(EnvironmentHandle);
	wchar_t* arg2 = formatSQLINTEGER(Attribute);
	wchar_t* arg3 = formatSQLPOINTER(Value);
	wchar_t* arg4 = formatSQLINTEGER(BufferLength);
	wchar_t* arg5 = formatPointer((void*)StringLength);
	log_odbc_call(L"SQLGetEnvAttr", ret, &tvStart, &tvEnd, 5, L"SQLHENV", L"EnvironmentHandle", arg1, L"SQLINTEGER", L"Attribute", arg2, L"SQLPOINTER", L"Value", arg3, L"SQLINTEGER", L"BufferLength", arg4, L"SQLINTEGER*", L"StringLength", arg5);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	return ret;
}

SQLRETURN SQL_API SQLGetInfo(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, __out_bcount_opt(BufferLength) SQLPOINTER InfoValue, SQLSMALLINT BufferLength, __out_opt SQLSMALLINT *StringLengthPtr)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLGetInfo(ConnectionHandle, InfoType, InfoValue, BufferLength, StringLengthPtr);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHDBC(ConnectionHandle);
	wchar_t* arg2 = formatSQLUSMALLINT(InfoType);
	wchar_t* arg3 = formatSQLPOINTER(InfoValue);
	wchar_t* arg4 = formatSQLSMALLINT(BufferLength);
	wchar_t* arg5 = formatPointer((void*)StringLengthPtr);
	log_odbc_call(L"SQLGetInfo", ret, &tvStart, &tvEnd, 5, L"SQLHDBC", L"ConnectionHandle", arg1, L"SQLUSMALLINT", L"InfoType", arg2, L"SQLPOINTER", L"InfoValue", arg3, L"SQLSMALLINT", L"BufferLength", arg4, L"SQLSMALLINT*", L"StringLengthPtr", arg5);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	return ret;
}

SQLRETURN SQL_API SQLGetInfoW( SQLHDBC                     hdbc, SQLUSMALLINT                fInfoType, __out_bcount_opt(cbInfoValueMax) SQLPOINTER rgbInfoValue, SQLSMALLINT        cbInfoValueMax, __out_opt SQLSMALLINT*                pcbInfoValue)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLGetInfoW(hdbc, fInfoType, rgbInfoValue, cbInfoValueMax, pcbInfoValue);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHDBC(hdbc);
	wchar_t* arg2 = formatSQLUSMALLINT(fInfoType);
	wchar_t* arg3 = formatSQLPOINTER(rgbInfoValue);
	wchar_t* arg4 = formatSQLSMALLINT(cbInfoValueMax);
	wchar_t* arg5 = formatPointer((void*)pcbInfoValue);
	log_odbc_call(L"SQLGetInfoW", ret, &tvStart, &tvEnd, 5, L"SQLHDBC", L"hdbc", arg1, L"SQLUSMALLINT", L"fInfoType", arg2, L"SQLPOINTER", L"rgbInfoValue", arg3, L"SQLSMALLINT", L"cbInfoValueMax", arg4, L"SQLSMALLINT*", L"pcbInfoValue", arg5);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	return ret;
}

SQLRETURN SQL_API SQLGetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, __out_xcount_opt(BufferLength) SQLPOINTER Value, SQLINTEGER BufferLength, __out_opt SQLINTEGER *StringLength)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLGetStmtAttr(StatementHandle, Attribute, Value, BufferLength, StringLength);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(StatementHandle);
	wchar_t* arg2 = formatSQLINTEGER(Attribute);
	wchar_t* arg3 = formatSQLPOINTER(Value);
	wchar_t* arg4 = formatSQLINTEGER(BufferLength);
	wchar_t* arg5 = formatPointer((void*)StringLength);
	log_odbc_call(L"SQLGetStmtAttr", ret, &tvStart, &tvEnd, 5, L"SQLHSTMT", L"StatementHandle", arg1, L"SQLINTEGER", L"Attribute", arg2, L"SQLPOINTER", L"Value", arg3, L"SQLINTEGER", L"BufferLength", arg4, L"SQLINTEGER*", L"StringLength", arg5);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	return ret;
}

SQLRETURN SQL_API SQLGetStmtAttrW( SQLHSTMT           hstmt, SQLINTEGER         fAttribute, SQLPOINTER         rgbValue, SQLINTEGER         cbValueMax, SQLINTEGER     *pcbValue)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLGetStmtAttrW(hstmt, fAttribute, rgbValue, cbValueMax, pcbValue);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLINTEGER(fAttribute);
	wchar_t* arg3 = formatSQLPOINTER(rgbValue);
	wchar_t* arg4 = formatSQLINTEGER(cbValueMax);
	wchar_t* arg5 = formatPointer((void*)pcbValue);
	log_odbc_call(L"SQLGetStmtAttrW", ret, &tvStart, &tvEnd, 5, L"SQLHSTMT", L"hstmt", arg1, L"SQLINTEGER", L"fAttribute", arg2, L"SQLPOINTER", L"rgbValue", arg3, L"SQLINTEGER", L"cbValueMax", arg4, L"SQLINTEGER*", L"pcbValue", arg5);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	return ret;
}

SQLRETURN SQL_API SQLGetTypeInfo(SQLHSTMT StatementHandle, SQLSMALLINT DataType)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLGetTypeInfo(StatementHandle, DataType);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(StatementHandle);
	wchar_t* arg2 = formatSQLSMALLINT(DataType);
	log_odbc_call(L"SQLGetTypeInfo", ret, &tvStart, &tvEnd, 2, L"SQLHSTMT", L"StatementHandle", arg1, L"SQLSMALLINT", L"DataType", arg2);
	delete [] arg1;
	delete [] arg2;
	return ret;
}

SQLRETURN SQL_API SQLGetTypeInfoW( SQLHSTMT            StatementHandle, SQLSMALLINT         DataType)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLGetTypeInfoW(StatementHandle, DataType);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(StatementHandle);
	wchar_t* arg2 = formatSQLSMALLINT(DataType);
	log_odbc_call(L"SQLGetTypeInfoW", ret, &tvStart, &tvEnd, 2, L"SQLHSTMT", L"StatementHandle", arg1, L"SQLSMALLINT", L"DataType", arg2);
	delete [] arg1;
	delete [] arg2;
	return ret;
}

SQLRETURN SQL_API SQLMoreResults( SQLHSTMT           hstmt)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLMoreResults(hstmt);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	log_odbc_call(L"SQLMoreResults", ret, &tvStart, &tvEnd, 1, L"SQLHSTMT", L"hstmt", arg1);
	delete [] arg1;
	return ret;
}

SQLRETURN SQL_API SQLNativeSql ( SQLHDBC            hdbc, __in_ecount(cchSqlStrIn) SQLCHAR* szSqlStrIn, SQLINTEGER  cchSqlStrIn, __out_ecount_opt(cchSqlStrMax) SQLCHAR* szSqlStr, SQLINTEGER         cchSqlStrMax, SQLINTEGER        *pcbSqlStr )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLNativeSql (hdbc, szSqlStrIn, cchSqlStrIn, szSqlStr, cchSqlStrMax, pcbSqlStr);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHDBC(hdbc);
	wchar_t* arg2 = formatSQLCHAR(szSqlStrIn);
	wchar_t* arg3 = formatSQLINTEGER(cchSqlStrIn);
	wchar_t* arg4 = formatSQLCHAR(szSqlStr);
	wchar_t* arg5 = formatSQLINTEGER(cchSqlStrMax);
	wchar_t* arg6 = formatPointer((void*)pcbSqlStr);
	log_odbc_call(L"SQLNativeSql ", ret, &tvStart, &tvEnd, 6, L"SQLHDBC", L"hdbc", arg1, L"SQLCHAR*", L"szSqlStrIn", arg2, L"SQLINTEGER", L"cchSqlStrIn", arg3, L"SQLCHAR*", L"szSqlStr", arg4, L"SQLINTEGER", L"cchSqlStrMax", arg5, L"SQLINTEGER*", L"pcbSqlStr", arg6);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	return ret;
}

SQLRETURN SQL_API SQLNativeSqlW ( SQLHDBC                                     hdbc, __in_ecount(cchSqlStrIn) SQLWCHAR*          szSqlStrIn, SQLINTEGER                                  cchSqlStrIn, __out_ecount_opt(cchSqlStrMax) SQLWCHAR*    szSqlStr, SQLINTEGER                                  cchSqlStrMax, SQLINTEGER*                                 pcchSqlStr )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLNativeSqlW (hdbc, szSqlStrIn, cchSqlStrIn, szSqlStr, cchSqlStrMax, pcchSqlStr);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHDBC(hdbc);
	wchar_t* arg2 = formatSQLWCHAR(szSqlStrIn);
	wchar_t* arg3 = formatSQLINTEGER(cchSqlStrIn);
	wchar_t* arg4 = formatSQLWCHAR(szSqlStr);
	wchar_t* arg5 = formatSQLINTEGER(cchSqlStrMax);
	wchar_t* arg6 = formatPointer((void*)pcchSqlStr);
	log_odbc_call(L"SQLNativeSqlW ", ret, &tvStart, &tvEnd, 6, L"SQLHDBC", L"hdbc", arg1, L"SQLWCHAR*", L"szSqlStrIn", arg2, L"SQLINTEGER", L"cchSqlStrIn", arg3, L"SQLWCHAR*", L"szSqlStr", arg4, L"SQLINTEGER", L"cchSqlStrMax", arg5, L"SQLINTEGER*", L"pcchSqlStr", arg6);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	return ret;
}

SQLRETURN SQL_API SQLNumResultCols(SQLHSTMT StatementHandle, __out SQLSMALLINT *ColumnCount)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLNumResultCols(StatementHandle, ColumnCount);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(StatementHandle);
	wchar_t* arg2 = formatPointer((void*)ColumnCount);
	log_odbc_call(L"SQLNumResultCols", ret, &tvStart, &tvEnd, 2, L"SQLHSTMT", L"StatementHandle", arg1, L"SQLSMALLINT*", L"ColumnCount", arg2);
	delete [] arg1;
	delete [] arg2;
	return ret;
}

SQLRETURN SQL_API SQLParamData(SQLHSTMT StatementHandle, __out_opt SQLPOINTER *Value)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLParamData(StatementHandle, Value);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(StatementHandle);
	wchar_t* arg2 = formatPointer((void*)Value);
	log_odbc_call(L"SQLParamData", ret, &tvStart, &tvEnd, 2, L"SQLHSTMT", L"StatementHandle", arg1, L"SQLPOINTER*", L"Value", arg2);
	delete [] arg1;
	delete [] arg2;
	return ret;
}

SQLRETURN SQL_API SQLPrepare ( SQLHSTMT StatementHandle, __in_ecount(TextLength) SQLCHAR* StatementText, SQLINTEGER TextLength )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLPrepare (StatementHandle, StatementText, TextLength);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(StatementHandle);
	wchar_t* arg2 = formatSQLCHAR(StatementText);
	wchar_t* arg3 = formatSQLINTEGER(TextLength);
	log_odbc_call(L"SQLPrepare ", ret, &tvStart, &tvEnd, 3, L"SQLHSTMT", L"StatementHandle", arg1, L"SQLCHAR*", L"StatementText", arg2, L"SQLINTEGER", L"TextLength", arg3);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	return ret;
}

SQLRETURN SQL_API SQLPrepareW ( SQLHSTMT    hstmt, __in_ecount(cchSqlStr) SQLWCHAR* szSqlStr, SQLINTEGER  cchSqlStr )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLPrepareW (hstmt, szSqlStr, cchSqlStr);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLWCHAR(szSqlStr);
	wchar_t* arg3 = formatSQLINTEGER(cchSqlStr);
	log_odbc_call(L"SQLPrepareW ", ret, &tvStart, &tvEnd, 3, L"SQLHSTMT", L"hstmt", arg1, L"SQLWCHAR*", L"szSqlStr", arg2, L"SQLINTEGER", L"cchSqlStr", arg3);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	return ret;
}

SQLRETURN SQL_API SQLPrimaryKeys( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLCHAR           *szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLCHAR           *szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLCHAR           *szTableName, SQLSMALLINT        cchTableName)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLPrimaryKeys(hstmt, szCatalogName, cchCatalogName, szSchemaName, cchSchemaName, szTableName, cchTableName);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLCHAR(szCatalogName);
	wchar_t* arg3 = formatSQLSMALLINT(cchCatalogName);
	wchar_t* arg4 = formatSQLCHAR(szSchemaName);
	wchar_t* arg5 = formatSQLSMALLINT(cchSchemaName);
	wchar_t* arg6 = formatSQLCHAR(szTableName);
	wchar_t* arg7 = formatSQLSMALLINT(cchTableName);
	log_odbc_call(L"SQLPrimaryKeys", ret, &tvStart, &tvEnd, 7, L"SQLHSTMT", L"hstmt", arg1, L"SQLCHAR*", L"szCatalogName", arg2, L"SQLSMALLINT", L"cchCatalogName", arg3, L"SQLCHAR*", L"szSchemaName", arg4, L"SQLSMALLINT", L"cchSchemaName", arg5, L"SQLCHAR*", L"szTableName", arg6, L"SQLSMALLINT", L"cchTableName", arg7);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	return ret;
}

SQLRETURN SQL_API SQLPrimaryKeysW ( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLWCHAR*    szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLWCHAR*     szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLWCHAR*      szTableName, SQLSMALLINT        cchTableName )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLPrimaryKeysW (hstmt, szCatalogName, cchCatalogName, szSchemaName, cchSchemaName, szTableName, cchTableName);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLWCHAR(szCatalogName);
	wchar_t* arg3 = formatSQLSMALLINT(cchCatalogName);
	wchar_t* arg4 = formatSQLWCHAR(szSchemaName);
	wchar_t* arg5 = formatSQLSMALLINT(cchSchemaName);
	wchar_t* arg6 = formatSQLWCHAR(szTableName);
	wchar_t* arg7 = formatSQLSMALLINT(cchTableName);
	log_odbc_call(L"SQLPrimaryKeysW ", ret, &tvStart, &tvEnd, 7, L"SQLHSTMT", L"hstmt", arg1, L"SQLWCHAR*", L"szCatalogName", arg2, L"SQLSMALLINT", L"cchCatalogName", arg3, L"SQLWCHAR*", L"szSchemaName", arg4, L"SQLSMALLINT", L"cchSchemaName", arg5, L"SQLWCHAR*", L"szTableName", arg6, L"SQLSMALLINT", L"cchTableName", arg7);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	return ret;
}

SQLRETURN SQL_API SQLProcedureColumns( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLCHAR           *szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLCHAR           *szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchProcName) SQLCHAR           *szProcName, SQLSMALLINT        cchProcName, __in_ecount_opt(cchColumnName) SQLCHAR           *szColumnName, SQLSMALLINT        cchColumnName)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLProcedureColumns(hstmt, szCatalogName, cchCatalogName, szSchemaName, cchSchemaName, szProcName, cchProcName, szColumnName, cchColumnName);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLCHAR(szCatalogName);
	wchar_t* arg3 = formatSQLSMALLINT(cchCatalogName);
	wchar_t* arg4 = formatSQLCHAR(szSchemaName);
	wchar_t* arg5 = formatSQLSMALLINT(cchSchemaName);
	wchar_t* arg6 = formatSQLCHAR(szProcName);
	wchar_t* arg7 = formatSQLSMALLINT(cchProcName);
	wchar_t* arg8 = formatSQLCHAR(szColumnName);
	wchar_t* arg9 = formatSQLSMALLINT(cchColumnName);
	log_odbc_call(L"SQLProcedureColumns", ret, &tvStart, &tvEnd, 9, L"SQLHSTMT", L"hstmt", arg1, L"SQLCHAR*", L"szCatalogName", arg2, L"SQLSMALLINT", L"cchCatalogName", arg3, L"SQLCHAR*", L"szSchemaName", arg4, L"SQLSMALLINT", L"cchSchemaName", arg5, L"SQLCHAR*", L"szProcName", arg6, L"SQLSMALLINT", L"cchProcName", arg7, L"SQLCHAR*", L"szColumnName", arg8, L"SQLSMALLINT", L"cchColumnName", arg9);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	delete [] arg8;
	delete [] arg9;
	return ret;
}

SQLRETURN SQL_API SQLProcedureColumnsW ( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLWCHAR*    szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLWCHAR*     szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchProcName) SQLWCHAR*       szProcName, SQLSMALLINT        cchProcName, __in_ecount_opt(cchColumnName) SQLWCHAR*     szColumnName, SQLSMALLINT        cchColumnName )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLProcedureColumnsW (hstmt, szCatalogName, cchCatalogName, szSchemaName, cchSchemaName, szProcName, cchProcName, szColumnName, cchColumnName);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLWCHAR(szCatalogName);
	wchar_t* arg3 = formatSQLSMALLINT(cchCatalogName);
	wchar_t* arg4 = formatSQLWCHAR(szSchemaName);
	wchar_t* arg5 = formatSQLSMALLINT(cchSchemaName);
	wchar_t* arg6 = formatSQLWCHAR(szProcName);
	wchar_t* arg7 = formatSQLSMALLINT(cchProcName);
	wchar_t* arg8 = formatSQLWCHAR(szColumnName);
	wchar_t* arg9 = formatSQLSMALLINT(cchColumnName);
	log_odbc_call(L"SQLProcedureColumnsW ", ret, &tvStart, &tvEnd, 9, L"SQLHSTMT", L"hstmt", arg1, L"SQLWCHAR*", L"szCatalogName", arg2, L"SQLSMALLINT", L"cchCatalogName", arg3, L"SQLWCHAR*", L"szSchemaName", arg4, L"SQLSMALLINT", L"cchSchemaName", arg5, L"SQLWCHAR*", L"szProcName", arg6, L"SQLSMALLINT", L"cchProcName", arg7, L"SQLWCHAR*", L"szColumnName", arg8, L"SQLSMALLINT", L"cchColumnName", arg9);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	delete [] arg8;
	delete [] arg9;
	return ret;
}

SQLRETURN SQL_API SQLProcedures( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLCHAR           *szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLCHAR           *szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchProcName) SQLCHAR           *szProcName, SQLSMALLINT        cchProcName)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLProcedures(hstmt, szCatalogName, cchCatalogName, szSchemaName, cchSchemaName, szProcName, cchProcName);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLCHAR(szCatalogName);
	wchar_t* arg3 = formatSQLSMALLINT(cchCatalogName);
	wchar_t* arg4 = formatSQLCHAR(szSchemaName);
	wchar_t* arg5 = formatSQLSMALLINT(cchSchemaName);
	wchar_t* arg6 = formatSQLCHAR(szProcName);
	wchar_t* arg7 = formatSQLSMALLINT(cchProcName);
	log_odbc_call(L"SQLProcedures", ret, &tvStart, &tvEnd, 7, L"SQLHSTMT", L"hstmt", arg1, L"SQLCHAR*", L"szCatalogName", arg2, L"SQLSMALLINT", L"cchCatalogName", arg3, L"SQLCHAR*", L"szSchemaName", arg4, L"SQLSMALLINT", L"cchSchemaName", arg5, L"SQLCHAR*", L"szProcName", arg6, L"SQLSMALLINT", L"cchProcName", arg7);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	return ret;
}

SQLRETURN SQL_API SQLProceduresW ( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLWCHAR*    szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLWCHAR*     szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchProcName) SQLWCHAR*      szProcName, SQLSMALLINT        cchProcName )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLProceduresW (hstmt, szCatalogName, cchCatalogName, szSchemaName, cchSchemaName, szProcName, cchProcName);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLWCHAR(szCatalogName);
	wchar_t* arg3 = formatSQLSMALLINT(cchCatalogName);
	wchar_t* arg4 = formatSQLWCHAR(szSchemaName);
	wchar_t* arg5 = formatSQLSMALLINT(cchSchemaName);
	wchar_t* arg6 = formatSQLWCHAR(szProcName);
	wchar_t* arg7 = formatSQLSMALLINT(cchProcName);
	log_odbc_call(L"SQLProceduresW ", ret, &tvStart, &tvEnd, 7, L"SQLHSTMT", L"hstmt", arg1, L"SQLWCHAR*", L"szCatalogName", arg2, L"SQLSMALLINT", L"cchCatalogName", arg3, L"SQLWCHAR*", L"szSchemaName", arg4, L"SQLSMALLINT", L"cchSchemaName", arg5, L"SQLWCHAR*", L"szProcName", arg6, L"SQLSMALLINT", L"cchProcName", arg7);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	return ret;
}

SQLRETURN SQL_API SQLPutData(SQLHSTMT StatementHandle, __in_xcount(StrLen_or_Ind) SQLPOINTER Data, SQLLEN StrLen_or_Ind)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLPutData(StatementHandle, Data, StrLen_or_Ind);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(StatementHandle);
	wchar_t* arg2 = formatSQLPOINTER(Data);
	wchar_t* arg3 = formatSQLLEN(StrLen_or_Ind);
	log_odbc_call(L"SQLPutData", ret, &tvStart, &tvEnd, 3, L"SQLHSTMT", L"StatementHandle", arg1, L"SQLPOINTER", L"Data", arg2, L"SQLLEN", L"StrLen_or_Ind", arg3);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	return ret;
}

SQLRETURN SQL_API SQLRowCount(__in SQLHSTMT StatementHandle, __out SQLLEN* RowCount)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLRowCount(StatementHandle, RowCount);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(StatementHandle);
	wchar_t* arg2 = formatPointer((void*)RowCount);
	log_odbc_call(L"SQLRowCount", ret, &tvStart, &tvEnd, 2, L"SQLHSTMT", L"StatementHandle", arg1, L"SQLLEN*", L"RowCount", arg2);
	delete [] arg1;
	delete [] arg2;
	return ret;
}

SQLRETURN SQL_API SQLSetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, __in_bcount_opt(StringLength) SQLPOINTER Value, SQLINTEGER StringLength)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLSetConnectAttr(ConnectionHandle, Attribute, Value, StringLength);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHDBC(ConnectionHandle);
	wchar_t* arg2 = formatSQLINTEGER(Attribute);
	wchar_t* arg3 = formatSQLPOINTER(Value);
	wchar_t* arg4 = formatSQLINTEGER(StringLength);
	log_odbc_call(L"SQLSetConnectAttr", ret, &tvStart, &tvEnd, 4, L"SQLHDBC", L"ConnectionHandle", arg1, L"SQLINTEGER", L"Attribute", arg2, L"SQLPOINTER", L"Value", arg3, L"SQLINTEGER", L"StringLength", arg4);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	return ret;
}

SQLRETURN SQL_API SQLSetConnectAttrW( SQLHDBC            hdbc, SQLINTEGER         fAttribute, __in_bcount_opt(cbValue) SQLPOINTER         rgbValue, SQLINTEGER         cbValue)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLSetConnectAttrW(hdbc, fAttribute, rgbValue, cbValue);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHDBC(hdbc);
	wchar_t* arg2 = formatSQLINTEGER(fAttribute);
	wchar_t* arg3 = formatSQLPOINTER(rgbValue);
	wchar_t* arg4 = formatSQLINTEGER(cbValue);
	log_odbc_call(L"SQLSetConnectAttrW", ret, &tvStart, &tvEnd, 4, L"SQLHDBC", L"hdbc", arg1, L"SQLINTEGER", L"fAttribute", arg2, L"SQLPOINTER", L"rgbValue", arg3, L"SQLINTEGER", L"cbValue", arg4);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	return ret;
}

SQLRETURN SQL_API SQLSetCursorName ( SQLHSTMT StatementHandle, __in_ecount(NameLength) SQLCHAR* CursorName, SQLSMALLINT NameLength )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLSetCursorName (StatementHandle, CursorName, NameLength);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(StatementHandle);
	wchar_t* arg2 = formatSQLCHAR(CursorName);
	wchar_t* arg3 = formatSQLSMALLINT(NameLength);
	log_odbc_call(L"SQLSetCursorName ", ret, &tvStart, &tvEnd, 3, L"SQLHSTMT", L"StatementHandle", arg1, L"SQLCHAR*", L"CursorName", arg2, L"SQLSMALLINT", L"NameLength", arg3);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	return ret;
}

SQLRETURN SQL_API SQLSetCursorNameW ( SQLHSTMT            hstmt, __in_ecount(cchCursor) SQLWCHAR* szCursor, SQLSMALLINT         cchCursor )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLSetCursorNameW (hstmt, szCursor, cchCursor);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLWCHAR(szCursor);
	wchar_t* arg3 = formatSQLSMALLINT(cchCursor);
	log_odbc_call(L"SQLSetCursorNameW ", ret, &tvStart, &tvEnd, 3, L"SQLHSTMT", L"hstmt", arg1, L"SQLWCHAR*", L"szCursor", arg2, L"SQLSMALLINT", L"cchCursor", arg3);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	return ret;
}

SQLRETURN SQL_API SQLSetDescField(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, __in_xcount(BufferLength) SQLPOINTER Value, SQLINTEGER BufferLength)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLSetDescField(DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHDESC(DescriptorHandle);
	wchar_t* arg2 = formatSQLSMALLINT(RecNumber);
	wchar_t* arg3 = formatSQLSMALLINT(FieldIdentifier);
	wchar_t* arg4 = formatSQLPOINTER(Value);
	wchar_t* arg5 = formatSQLINTEGER(BufferLength);
	log_odbc_call(L"SQLSetDescField", ret, &tvStart, &tvEnd, 5, L"SQLHDESC", L"DescriptorHandle", arg1, L"SQLSMALLINT", L"RecNumber", arg2, L"SQLSMALLINT", L"FieldIdentifier", arg3, L"SQLPOINTER", L"Value", arg4, L"SQLINTEGER", L"BufferLength", arg5);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	return ret;
}

SQLRETURN SQL_API SQLSetDescFieldW ( SQLHDESC        DescriptorHandle, SQLSMALLINT     RecNumber, SQLSMALLINT     FieldIdentifier, SQLPOINTER      Value, SQLINTEGER      BufferLength )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLSetDescFieldW (DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHDESC(DescriptorHandle);
	wchar_t* arg2 = formatSQLSMALLINT(RecNumber);
	wchar_t* arg3 = formatSQLSMALLINT(FieldIdentifier);
	wchar_t* arg4 = formatSQLPOINTER(Value);
	wchar_t* arg5 = formatSQLINTEGER(BufferLength);
	log_odbc_call(L"SQLSetDescFieldW ", ret, &tvStart, &tvEnd, 5, L"SQLHDESC", L"DescriptorHandle", arg1, L"SQLSMALLINT", L"RecNumber", arg2, L"SQLSMALLINT", L"FieldIdentifier", arg3, L"SQLPOINTER", L"Value", arg4, L"SQLINTEGER", L"BufferLength", arg5);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	return ret;
}

SQLRETURN SQL_API SQLSetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT Type, SQLSMALLINT SubType, SQLLEN Length, SQLSMALLINT Precision, SQLSMALLINT Scale, __inout_bcount_opt(Length) SQLPOINTER Data, __inout_opt SQLLEN *StringLength, __inout_opt SQLLEN *Indicator)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLSetDescRec(DescriptorHandle, RecNumber, Type, SubType, Length, Precision, Scale, Data, StringLength, Indicator);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHDESC(DescriptorHandle);
	wchar_t* arg2 = formatSQLSMALLINT(RecNumber);
	wchar_t* arg3 = formatSQLSMALLINT(Type);
	wchar_t* arg4 = formatSQLSMALLINT(SubType);
	wchar_t* arg5 = formatSQLLEN(Length);
	wchar_t* arg6 = formatSQLSMALLINT(Precision);
	wchar_t* arg7 = formatSQLSMALLINT(Scale);
	wchar_t* arg8 = formatSQLPOINTER(Data);
	wchar_t* arg9 = formatPointer((void*)StringLength);
	wchar_t* arg10 = formatPointer((void*)Indicator);
	log_odbc_call(L"SQLSetDescRec", ret, &tvStart, &tvEnd, 10, L"SQLHDESC", L"DescriptorHandle", arg1, L"SQLSMALLINT", L"RecNumber", arg2, L"SQLSMALLINT", L"Type", arg3, L"SQLSMALLINT", L"SubType", arg4, L"SQLLEN", L"Length", arg5, L"SQLSMALLINT", L"Precision", arg6, L"SQLSMALLINT", L"Scale", arg7, L"SQLPOINTER", L"Data", arg8, L"SQLLEN*", L"StringLength", arg9, L"SQLLEN*", L"Indicator", arg10);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	delete [] arg8;
	delete [] arg9;
	delete [] arg10;
	return ret;
}

SQLRETURN SQL_API SQLSetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, __in_bcount(StringLength) SQLPOINTER Value, SQLINTEGER StringLength)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLSetEnvAttr(EnvironmentHandle, Attribute, Value, StringLength);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHENV(EnvironmentHandle);
	wchar_t* arg2 = formatSQLINTEGER(Attribute);
	wchar_t* arg3 = formatSQLPOINTER(Value);
	wchar_t* arg4 = formatSQLINTEGER(StringLength);
	log_odbc_call(L"SQLSetEnvAttr", ret, &tvStart, &tvEnd, 4, L"SQLHENV", L"EnvironmentHandle", arg1, L"SQLINTEGER", L"Attribute", arg2, L"SQLPOINTER", L"Value", arg3, L"SQLINTEGER", L"StringLength", arg4);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	return ret;
}

SQLRETURN SQL_API SQLSetPos( SQLHSTMT           hstmt, SQLSETPOSIROW      irow, SQLUSMALLINT       fOption, SQLUSMALLINT       fLock)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLSetPos(hstmt, irow, fOption, fLock);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLSETPOSIROW(irow);
	wchar_t* arg3 = formatSQLUSMALLINT(fOption);
	wchar_t* arg4 = formatSQLUSMALLINT(fLock);
	log_odbc_call(L"SQLSetPos", ret, &tvStart, &tvEnd, 4, L"SQLHSTMT", L"hstmt", arg1, L"SQLSETPOSIROW", L"irow", arg2, L"SQLUSMALLINT", L"fOption", arg3, L"SQLUSMALLINT", L"fLock", arg4);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	return ret;
}

SQLRETURN SQL_API SQLSetScrollOptions( SQLHSTMT           hstmt, SQLUSMALLINT       fConcurrency, SQLLEN             crowKeyset, SQLUSMALLINT       crowRowset)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLSetScrollOptions(hstmt, fConcurrency, crowKeyset, crowRowset);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLUSMALLINT(fConcurrency);
	wchar_t* arg3 = formatSQLLEN(crowKeyset);
	wchar_t* arg4 = formatSQLUSMALLINT(crowRowset);
	log_odbc_call(L"SQLSetScrollOptions", ret, &tvStart, &tvEnd, 4, L"SQLHSTMT", L"hstmt", arg1, L"SQLUSMALLINT", L"fConcurrency", arg2, L"SQLLEN", L"crowKeyset", arg3, L"SQLUSMALLINT", L"crowRowset", arg4);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	return ret;
}

SQLRETURN SQL_API SQLSetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, __in_xcount(StringLength) SQLPOINTER Value, SQLINTEGER StringLength)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLSetStmtAttr(StatementHandle, Attribute, Value, StringLength);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(StatementHandle);
	wchar_t* arg2 = formatSQLINTEGER(Attribute);
	wchar_t* arg3 = formatSQLPOINTER(Value);
	wchar_t* arg4 = formatSQLINTEGER(StringLength);
	log_odbc_call(L"SQLSetStmtAttr", ret, &tvStart, &tvEnd, 4, L"SQLHSTMT", L"StatementHandle", arg1, L"SQLINTEGER", L"Attribute", arg2, L"SQLPOINTER", L"Value", arg3, L"SQLINTEGER", L"StringLength", arg4);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	return ret;
}

SQLRETURN SQL_API SQLSetStmtAttrW( SQLHSTMT           hstmt, SQLINTEGER         fAttribute, SQLPOINTER         rgbValue, SQLINTEGER         cbValueMax)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLSetStmtAttrW(hstmt, fAttribute, rgbValue, cbValueMax);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLINTEGER(fAttribute);
	wchar_t* arg3 = formatSQLPOINTER(rgbValue);
	wchar_t* arg4 = formatSQLINTEGER(cbValueMax);
	log_odbc_call(L"SQLSetStmtAttrW", ret, &tvStart, &tvEnd, 4, L"SQLHSTMT", L"hstmt", arg1, L"SQLINTEGER", L"fAttribute", arg2, L"SQLPOINTER", L"rgbValue", arg3, L"SQLINTEGER", L"cbValueMax", arg4);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	return ret;
}

SQLRETURN SQL_API SQLSpecialColumns(SQLHSTMT StatementHandle, SQLUSMALLINT IdentifierType, __in_ecount_opt(NameLength1) SQLCHAR *CatalogName, SQLSMALLINT NameLength1, __in_ecount_opt(NameLength2) SQLCHAR *SchemaName, SQLSMALLINT NameLength2, __in_ecount_opt(NameLength3) SQLCHAR *TableName, SQLSMALLINT NameLength3, SQLUSMALLINT Scope, SQLUSMALLINT Nullable)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLSpecialColumns(StatementHandle, IdentifierType, CatalogName, NameLength1, SchemaName, NameLength2, TableName, NameLength3, Scope, Nullable);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(StatementHandle);
	wchar_t* arg2 = formatSQLUSMALLINT(IdentifierType);
	wchar_t* arg3 = formatSQLCHAR(CatalogName);
	wchar_t* arg4 = formatSQLSMALLINT(NameLength1);
	wchar_t* arg5 = formatSQLCHAR(SchemaName);
	wchar_t* arg6 = formatSQLSMALLINT(NameLength2);
	wchar_t* arg7 = formatSQLCHAR(TableName);
	wchar_t* arg8 = formatSQLSMALLINT(NameLength3);
	wchar_t* arg9 = formatSQLUSMALLINT(Scope);
	wchar_t* arg10 = formatSQLUSMALLINT(Nullable);
	log_odbc_call(L"SQLSpecialColumns", ret, &tvStart, &tvEnd, 10, L"SQLHSTMT", L"StatementHandle", arg1, L"SQLUSMALLINT", L"IdentifierType", arg2, L"SQLCHAR*", L"CatalogName", arg3, L"SQLSMALLINT", L"NameLength1", arg4, L"SQLCHAR*", L"SchemaName", arg5, L"SQLSMALLINT", L"NameLength2", arg6, L"SQLCHAR*", L"TableName", arg7, L"SQLSMALLINT", L"NameLength3", arg8, L"SQLUSMALLINT", L"Scope", arg9, L"SQLUSMALLINT", L"Nullable", arg10);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	delete [] arg8;
	delete [] arg9;
	delete [] arg10;
	return ret;
}

SQLRETURN SQL_API SQLSpecialColumnsW ( SQLHSTMT           hstmt, SQLUSMALLINT       fColType, __in_ecount_opt(cchCatalogName) SQLWCHAR*    szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLWCHAR*     szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLWCHAR*      szTableName, SQLSMALLINT        cchTableName, SQLUSMALLINT       fScope, SQLUSMALLINT       fNullable )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLSpecialColumnsW (hstmt, fColType, szCatalogName, cchCatalogName, szSchemaName, cchSchemaName, szTableName, cchTableName, fScope, fNullable);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLUSMALLINT(fColType);
	wchar_t* arg3 = formatSQLWCHAR(szCatalogName);
	wchar_t* arg4 = formatSQLSMALLINT(cchCatalogName);
	wchar_t* arg5 = formatSQLWCHAR(szSchemaName);
	wchar_t* arg6 = formatSQLSMALLINT(cchSchemaName);
	wchar_t* arg7 = formatSQLWCHAR(szTableName);
	wchar_t* arg8 = formatSQLSMALLINT(cchTableName);
	wchar_t* arg9 = formatSQLUSMALLINT(fScope);
	wchar_t* arg10 = formatSQLUSMALLINT(fNullable);
	log_odbc_call(L"SQLSpecialColumnsW ", ret, &tvStart, &tvEnd, 10, L"SQLHSTMT", L"hstmt", arg1, L"SQLUSMALLINT", L"fColType", arg2, L"SQLWCHAR*", L"szCatalogName", arg3, L"SQLSMALLINT", L"cchCatalogName", arg4, L"SQLWCHAR*", L"szSchemaName", arg5, L"SQLSMALLINT", L"cchSchemaName", arg6, L"SQLWCHAR*", L"szTableName", arg7, L"SQLSMALLINT", L"cchTableName", arg8, L"SQLUSMALLINT", L"fScope", arg9, L"SQLUSMALLINT", L"fNullable", arg10);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	delete [] arg8;
	delete [] arg9;
	delete [] arg10;
	return ret;
}

SQLRETURN SQL_API SQLStatistics(SQLHSTMT StatementHandle, __in_ecount_opt(NameLength1) SQLCHAR *CatalogName, SQLSMALLINT NameLength1, __in_ecount_opt(NameLength2) SQLCHAR *SchemaName, SQLSMALLINT NameLength2, __in_ecount_opt(NameLength3) SQLCHAR *TableName, SQLSMALLINT NameLength3, SQLUSMALLINT Unique, SQLUSMALLINT Reserved)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLStatistics(StatementHandle, CatalogName, NameLength1, SchemaName, NameLength2, TableName, NameLength3, Unique, Reserved);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(StatementHandle);
	wchar_t* arg2 = formatSQLCHAR(CatalogName);
	wchar_t* arg3 = formatSQLSMALLINT(NameLength1);
	wchar_t* arg4 = formatSQLCHAR(SchemaName);
	wchar_t* arg5 = formatSQLSMALLINT(NameLength2);
	wchar_t* arg6 = formatSQLCHAR(TableName);
	wchar_t* arg7 = formatSQLSMALLINT(NameLength3);
	wchar_t* arg8 = formatSQLUSMALLINT(Unique);
	wchar_t* arg9 = formatSQLUSMALLINT(Reserved);
	log_odbc_call(L"SQLStatistics", ret, &tvStart, &tvEnd, 9, L"SQLHSTMT", L"StatementHandle", arg1, L"SQLCHAR*", L"CatalogName", arg2, L"SQLSMALLINT", L"NameLength1", arg3, L"SQLCHAR*", L"SchemaName", arg4, L"SQLSMALLINT", L"NameLength2", arg5, L"SQLCHAR*", L"TableName", arg6, L"SQLSMALLINT", L"NameLength3", arg7, L"SQLUSMALLINT", L"Unique", arg8, L"SQLUSMALLINT", L"Reserved", arg9);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	delete [] arg8;
	delete [] arg9;
	return ret;
}

SQLRETURN SQL_API SQLStatisticsW ( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLWCHAR*    szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLWCHAR*     szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLWCHAR*      szTableName, SQLSMALLINT        cchTableName, SQLUSMALLINT       fUnique, SQLUSMALLINT       fAccuracy )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLStatisticsW (hstmt, szCatalogName, cchCatalogName, szSchemaName, cchSchemaName, szTableName, cchTableName, fUnique, fAccuracy);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLWCHAR(szCatalogName);
	wchar_t* arg3 = formatSQLSMALLINT(cchCatalogName);
	wchar_t* arg4 = formatSQLWCHAR(szSchemaName);
	wchar_t* arg5 = formatSQLSMALLINT(cchSchemaName);
	wchar_t* arg6 = formatSQLWCHAR(szTableName);
	wchar_t* arg7 = formatSQLSMALLINT(cchTableName);
	wchar_t* arg8 = formatSQLUSMALLINT(fUnique);
	wchar_t* arg9 = formatSQLUSMALLINT(fAccuracy);
	log_odbc_call(L"SQLStatisticsW ", ret, &tvStart, &tvEnd, 9, L"SQLHSTMT", L"hstmt", arg1, L"SQLWCHAR*", L"szCatalogName", arg2, L"SQLSMALLINT", L"cchCatalogName", arg3, L"SQLWCHAR*", L"szSchemaName", arg4, L"SQLSMALLINT", L"cchSchemaName", arg5, L"SQLWCHAR*", L"szTableName", arg6, L"SQLSMALLINT", L"cchTableName", arg7, L"SQLUSMALLINT", L"fUnique", arg8, L"SQLUSMALLINT", L"fAccuracy", arg9);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	delete [] arg8;
	delete [] arg9;
	return ret;
}

SQLRETURN SQL_API SQLTablePrivileges( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLCHAR           *szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLCHAR           *szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLCHAR           *szTableName, SQLSMALLINT        cchTableName)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLTablePrivileges(hstmt, szCatalogName, cchCatalogName, szSchemaName, cchSchemaName, szTableName, cchTableName);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLCHAR(szCatalogName);
	wchar_t* arg3 = formatSQLSMALLINT(cchCatalogName);
	wchar_t* arg4 = formatSQLCHAR(szSchemaName);
	wchar_t* arg5 = formatSQLSMALLINT(cchSchemaName);
	wchar_t* arg6 = formatSQLCHAR(szTableName);
	wchar_t* arg7 = formatSQLSMALLINT(cchTableName);
	log_odbc_call(L"SQLTablePrivileges", ret, &tvStart, &tvEnd, 7, L"SQLHSTMT", L"hstmt", arg1, L"SQLCHAR*", L"szCatalogName", arg2, L"SQLSMALLINT", L"cchCatalogName", arg3, L"SQLCHAR*", L"szSchemaName", arg4, L"SQLSMALLINT", L"cchSchemaName", arg5, L"SQLCHAR*", L"szTableName", arg6, L"SQLSMALLINT", L"cchTableName", arg7);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	return ret;
}

SQLRETURN SQL_API SQLTablePrivilegesW ( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLWCHAR*    szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLWCHAR*     szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLWCHAR*      szTableName, SQLSMALLINT        cchTableName )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLTablePrivilegesW (hstmt, szCatalogName, cchCatalogName, szSchemaName, cchSchemaName, szTableName, cchTableName);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLWCHAR(szCatalogName);
	wchar_t* arg3 = formatSQLSMALLINT(cchCatalogName);
	wchar_t* arg4 = formatSQLWCHAR(szSchemaName);
	wchar_t* arg5 = formatSQLSMALLINT(cchSchemaName);
	wchar_t* arg6 = formatSQLWCHAR(szTableName);
	wchar_t* arg7 = formatSQLSMALLINT(cchTableName);
	log_odbc_call(L"SQLTablePrivilegesW ", ret, &tvStart, &tvEnd, 7, L"SQLHSTMT", L"hstmt", arg1, L"SQLWCHAR*", L"szCatalogName", arg2, L"SQLSMALLINT", L"cchCatalogName", arg3, L"SQLWCHAR*", L"szSchemaName", arg4, L"SQLSMALLINT", L"cchSchemaName", arg5, L"SQLWCHAR*", L"szTableName", arg6, L"SQLSMALLINT", L"cchTableName", arg7);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	return ret;
}

SQLRETURN SQL_API SQLTables(SQLHSTMT StatementHandle, __in_ecount_opt(NameLength1) SQLCHAR *CatalogName, SQLSMALLINT NameLength1, __in_ecount_opt(NameLength2) SQLCHAR *SchemaName, SQLSMALLINT NameLength2, __in_ecount_opt(NameLength3) SQLCHAR *TableName, SQLSMALLINT NameLength3, __in_ecount_opt(NameLength4) SQLCHAR *TableType, SQLSMALLINT NameLength4)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLTables(StatementHandle, CatalogName, NameLength1, SchemaName, NameLength2, TableName, NameLength3, TableType, NameLength4);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(StatementHandle);
	wchar_t* arg2 = formatSQLCHAR(CatalogName);
	wchar_t* arg3 = formatSQLSMALLINT(NameLength1);
	wchar_t* arg4 = formatSQLCHAR(SchemaName);
	wchar_t* arg5 = formatSQLSMALLINT(NameLength2);
	wchar_t* arg6 = formatSQLCHAR(TableName);
	wchar_t* arg7 = formatSQLSMALLINT(NameLength3);
	wchar_t* arg8 = formatSQLCHAR(TableType);
	wchar_t* arg9 = formatSQLSMALLINT(NameLength4);
	log_odbc_call(L"SQLTables", ret, &tvStart, &tvEnd, 9, L"SQLHSTMT", L"StatementHandle", arg1, L"SQLCHAR*", L"CatalogName", arg2, L"SQLSMALLINT", L"NameLength1", arg3, L"SQLCHAR*", L"SchemaName", arg4, L"SQLSMALLINT", L"NameLength2", arg5, L"SQLCHAR*", L"TableName", arg6, L"SQLSMALLINT", L"NameLength3", arg7, L"SQLCHAR*", L"TableType", arg8, L"SQLSMALLINT", L"NameLength4", arg9);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	delete [] arg8;
	delete [] arg9;
	return ret;
}

SQLRETURN SQL_API SQLTablesW ( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLWCHAR*    szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLWCHAR*     szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLWCHAR*      szTableName, SQLSMALLINT        cchTableName, __in_ecount_opt(cchTableType) SQLWCHAR*      szTableType, SQLSMALLINT        cchTableType )  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLTablesW (hstmt, szCatalogName, cchCatalogName, szSchemaName, cchSchemaName, szTableName, cchTableName, szTableType, cchTableType);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHSTMT(hstmt);
	wchar_t* arg2 = formatSQLWCHAR(szCatalogName);
	wchar_t* arg3 = formatSQLSMALLINT(cchCatalogName);
	wchar_t* arg4 = formatSQLWCHAR(szSchemaName);
	wchar_t* arg5 = formatSQLSMALLINT(cchSchemaName);
	wchar_t* arg6 = formatSQLWCHAR(szTableName);
	wchar_t* arg7 = formatSQLSMALLINT(cchTableName);
	wchar_t* arg8 = formatSQLWCHAR(szTableType);
	wchar_t* arg9 = formatSQLSMALLINT(cchTableType);
	log_odbc_call(L"SQLTablesW ", ret, &tvStart, &tvEnd, 9, L"SQLHSTMT", L"hstmt", arg1, L"SQLWCHAR*", L"szCatalogName", arg2, L"SQLSMALLINT", L"cchCatalogName", arg3, L"SQLWCHAR*", L"szSchemaName", arg4, L"SQLSMALLINT", L"cchSchemaName", arg5, L"SQLWCHAR*", L"szTableName", arg6, L"SQLSMALLINT", L"cchTableName", arg7, L"SQLWCHAR*", L"szTableType", arg8, L"SQLSMALLINT", L"cchTableType", arg9);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	delete [] arg4;
	delete [] arg5;
	delete [] arg6;
	delete [] arg7;
	delete [] arg8;
	delete [] arg9;
	return ret;
}

SQLRETURN SQL_API SQLTransact(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType)  {
	struct timeval tvStart, tvEnd;
	gettimeofday(&tvStart, NULL);
	SQLRETURN ret = getWrapper()==NULL ? SQL_ERROR : getWrapper()->SQLTransact(EnvironmentHandle, ConnectionHandle, CompletionType);
	gettimeofday(&tvEnd, NULL);
	wchar_t* arg1 = formatSQLHENV(EnvironmentHandle);
	wchar_t* arg2 = formatSQLHDBC(ConnectionHandle);
	wchar_t* arg3 = formatSQLUSMALLINT(CompletionType);
	log_odbc_call(L"SQLTransact", ret, &tvStart, &tvEnd, 3, L"SQLHENV", L"EnvironmentHandle", arg1, L"SQLHDBC", L"ConnectionHandle", arg2, L"SQLUSMALLINT", L"CompletionType", arg3);
	delete [] arg1;
	delete [] arg2;
	delete [] arg3;
	return ret;
}